private ParamObj(objT: {name: string, age: number}) {
let people = objT
console.log(objT)
let people = {name: "hwm", age: 18}
this.ParamObj(people) // {name: "hwm", age: 18}
interface obj {
[idx: string]: any
private ParamObj(objT: obj) {
let people = objT
console.log(objT)
let people:obj = {}
people.name = "lll"
people.age = 20
this.ParamObj(people) // {name: "lll", age: 20}
3.3 方法返回对象
private ReturnObj(): {name: string, age: number}{
let people = {name: "hwm", age: 18}
return people
let res = this.ReturnObj()
console.log(res) // {name: "hwm", age: 18}
3.4 对象数组
let tbl: {<!--{C}%3C!%2D%2D%20%2D%2D%3E-->name: string, age: number}[] = []