JSFiddle - React, Tailwind, and code Playground
JavaScript
function toPairs(obj){
var arr = Object.keys(obj);
return arr.map(item) => {
return ([item, obj[item]]);
})
}
console.log(toPairs({a:1, b:2, c:3}));
function toPairs(obj){
var arr = Object.keys(obj);
return arr.map(item) => {
return ([item, obj[item]]);
})
}
console.log(toPairs({a:1, b:2, c:3}));