Converting an Object to an Array in Javascript


Convert an object’s properties to an array using Object.keys, Object.values, or Object.entries.

Source Code

let person = { name: 'John', age: 30 };
let entries = Object.entries(person);
console.log(entries);
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments