JavaScript Object.entries() Method
The Object.entries() static method returns an array of an object's [key, value] pairs, which makes it easy to loop over or transform an object.
Description
The Object.entries() static method returns an array of the object's own enumerable [key, value] pairs, in the same order as a for...in loop. Combined with for...of and destructuring, it's the cleanest way to loop over an object.
It also pairs with Object.fromEntries() to transform objects: convert to entries, use array methods such as map() or filter(), then convert back.
Only the object's own enumerable string-keyed properties are included; inherited properties and symbol keys are left out. For arrays, the keys are index strings, so Object.entries(['a']) gives [['0', 'a']]. Maps already have their own entries() method, which returns an iterator.
Syntax
Object.entries(obj)Parameters
- objThe object to work with.
Return Value
An array of [key, value] pairs for the object's own enumerable string-keyed properties.
Example
Browser Support
The following information will show you the current browser support for the Object.entries() method. Hover over a browser icon to see the version that first introduced support for this method.
Desktop





Tablets & Mobile





