Skip to content

Latest commit

 

History

History
32 lines (22 loc) · 576 Bytes

File metadata and controls

32 lines (22 loc) · 576 Bytes

Object.entries()Object.values()

Object.entries()

函数签名

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()

函数签名

Object.values(value: any): Array<any>

References