how to convert array convert object of array in js code example
Example 1: 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);
Example 2: how can i convert object to an array javascript
const entries = Object.entries(person);
console.log(entries);
Code language: JavaScript (javascript)