Object values() method

Find out all the information about the JavaScript values() method of the Object object

This method returns an array containing all the object's own property values.


const person = { name: 'Fred', age: 87 }
Object.values(person) // ['Fred', 87]

Object.values()Also applies to arrays:

const people = ['Fred', 'Tony']
Object.values(people) // ['Fred', 'Tony']

Download mine for freeJavaScript beginner's manual

More js tutorials: