Skip to content
Some drops of JavaScript
GitHub

Object values: `values()`

Getting all the values of an object using Object.values()

The Object.values() method returns an array containing all the values associated with an object’s own enumerable properties.

const  user  = {
name: 'John',
age: 30,
}

console.log(Object.values(user)); // ['John', 30]