JS: Object.entries
New in JS2017.
Object.entries(obj)
-
Return a Array of
[key, value]
pairs that are obj's properties that are own, string key, and Enumerable .console.log(Object.entries({ a: 3, b: 4 })); // [ [ "a", 3 ], [ "b", 4 ] ]
New in JS2017.
Object.entries(obj)
[key, value]
pairs that are
obj's
properties that are own, string key, and
Enumerable
.
console.log(Object.entries({ a: 3, b: 4 })); // [ [ "a", 3 ], [ "b", 4 ] ]