Answers for "javascript covert object to arra"

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
0

convert object to array

$array = json_decode(json_encode($object), true);
Posted by: Guest on January-26-2022

Code answers related to "Javascript"

Browse Popular Code Answers by Language