Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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] ]
Source by www.samanthaming.com #
 
PREVIOUS NEXT
Tagged: #javascript #object #array
ADD COMMENT
Topic
Name
9+6 =