This method returns an array containing all the object own property values.
此方法返回一个包含所有对象自身属性值的数组。
Usage:
用法:
const person = { name: 'Fred', age: 87 }
Object.values(person) // ['Fred', 87]
Object.values()
also works with arrays:
Object.values()
也可用于数组:
const people = ['Fred', 'Tony']
Object.values(people) // ['Fred', 'Tony']