Categories
JavaScript Answers

How to convert JavaScript object with numeric keys into array?

Spread the love

To convert JavaScript object with numeric keys into array, we call the Object.values method.

For instance, we write

const arr = Object.values(obj);

to call Object.values with obj to return an array of property values in the obj object.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published.