JS: Object.entries

JS: Object.entries

New in ES2017.

Object.entries ( obj )

Return a array of [key,value] pairs that are obj's string property keys that are own and enumerable.

[see JS: Property Attributes, writable, enumerable, configurable]

[see JS: List Properties]

const obj = {"a":3, "b":4};

console.log ( Object.entries(obj) );
// [ [ 'a', 3 ], [ 'b', 4 ] ]
Like it? Help me by telling your friends. Or, Put $5 at patreon.

Or, Buy JavaScript in Depth

If you have a question, put $5 at patreon and message me.

Web Dev Tutorials