Convert object to array
17/07/2018 — 1 Min Read — In JavaScript
JavaScript TIP: Convert object to array
const obj = { 0: 'Frontend', 1: 'Snips' };
const arr = Object.keys(obj).map(key => obj[key]);
console.log(arr);
JavaScript TIP: Convert object to array
const obj = { 0: 'Frontend', 1: 'Snips' };
const arr = Object.keys(obj).map(key => obj[key]);
console.log(arr);