函数签名
Object.entries(value: any) : Array<[string, any]>
举个例子:
let obj = { one: 1, two: 2 }
for (let [k, v] of Object.entries(obj)) {
console.log(`${k} = ${v}`)
}
// one = 1
// two = 2
函数签名
Object.values(value: any): Array<any>
- Object.entries() 和 Object.values() | exploringjs.com - Dr. Axel Rauschmayer