Skip to content
FLAVIO COPES
flaviocopes.com

The Object values() method

By

Learn how the JavaScript Object.values() method returns an array containing all the own property values of an object, and how it also works with arrays.

~~~

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:

const people = ['Fred', 'Tony']
Object.values(people) // ['Fred', 'Tony']
Tagged: JavaScript ยท All topics
~~~

Related posts about js: