Answers for "transform object to the array"

8

convert object to array javascript

var object = {'Apple':1,'Banana':8,'Pineapple':null};
//convert object keys to array
var k = Object.keys(object);
//convert object values to array
var v = Object.values(object);
Posted by: Guest on February-22-2020
0

convert object to array

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

Code answers related to "transform object to the array"

Code answers related to "Javascript"

Browse Popular Code Answers by Language