const person = { name: 'Fred', age: 87 }Object.values(person) // ['Fred', 87]複製代碼
const person = { name: 'Fred', age: 87 }Object.entries(person) // [['name', 'Fred'], ['age', 87]]const people = ['Fred', 'Tony']Object.entries(people) // [['0', 'Fred'], ['1', 'Tony']]複製代碼