Answers for "how to convert object to array in javascrupt"

14

javascript object to array

//ES6 Object to Array

const numbers = {
  one: 1,
  two: 2,
};

console.log(Object.values(numbers));
// [ 1, 2 ]

console.log(Object.entries(numbers));
// [ ['one', 1], ['two', 2] ]
Posted by: Guest on April-20-2020
2

how to convert object to array in javascript

const propertyValues = Object.values(person);

console.log(propertyValues);
Posted by: Guest on December-09-2020

Code answers related to "how to convert object to array in javascrupt"

Code answers related to "Javascript"

Browse Popular Code Answers by Language