JSFiddle - React, Tailwind, and code Playground

by Evgeniy Kvasyuk

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}));