Object.entries()
to get an array of key-value pair arrays from the given object.const objectToPairs = obj => Object.entries(obj);
objectToPairs({ a: 1, b: 2 }); // [ ['a', 1], ['b', 2] ]
Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️