Learning JavaScript? Download my free JavaScript Handbook 🔥

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']


NEW

Follow my new project: From Zero to App

A video-based learning project where I create a React + GraphQL app from idea to deployment! 9 free videos already out!