JSFiddle - React, Tailwind, and code Playground

by Evgeniy Kvasyuk

JavaScript

function toPairs(input) {
    if(typeof input !== 'object')
        return false;
    
    let result = [];
    for(let key in input) {
        result.push([key, input]);
    }
    
    return result;
}


console.log(toPairs({a:1, b:2, c:3}));