let o = { a: "foo", b: 12, c: "bar"} 下面这句我能理解: let {a: newName1, b: newName2} = o; 但下面这个怎么理解?冒句后面的{a: string, b: number} 是{a,b}中a和b的类型吗?而且我查看a,b的值是undefined ,为什么? let {a, b}: {a: string, b: number} = o;
阅读量:147
点赞量:0