Get to know MDN better
This feature is well established and works across many devices and browser versions. It’s been available across browsers since March 2017.
The Object.entries() static method returns an array of a given object's own enumerable string-keyed property key-value pairs.
An object.
An array of the given object's own enumerable string-keyed property key-value pairs. Each key-value pair is an array with two elements: the first element is the property key (which is always a string), and the second element is the property value.
Object.entries() returns an array whose elements are arrays corresponding to the enumerable string-keyed property key-value pairs found directly upon object. This is the same as iterating with a for...in loop, except that a for...in loop enumerates properties in the prototype chain as well. The order of the array returned by Object.entries() is the same as that provided by a for...in loop.
If you only need the property keys, use Object.keys() instead. If you only need the property values, use Object.values() instead.
Non-object arguments are coerced to objects. undefined and null cannot be coerced to objects and throw a TypeError upfront. Only strings may have own enumerable properties, while all other primitives return an empty array.
The Map() constructor accepts an iterable of entries. With Object.entries, you can easily convert from Object to Map:
Using array destructuring, you can iterate through objects easily.
| ECMAScript® 2027 Language Specification # sec-object.entries |
Enable JavaScript to view this browser compatibility table.
This page was last modified on Jul 20, 2025 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.