JavaScript Object.entries() Method

JavaScript Object.entries() method is used to return an array of a given object's own enumerable property [key, value] pairs. The ordering of the properties is the same as that given by looping over the property values of the object manually.

Syntax:

Parameter

Obj: It is an object whose enumerable property [key, value] pair are to be returned.

Return value:

This method returns an array of the given object's own enumerable property [key, value] pairs.

Browser Support:

Chrome38
EdgeYes
Firefox28
OperaNo

Example 1

Output:

["23", "carry"]

Example 2

Output:

["3", "carry"]

Example 3

Output:

["10", "arvind"]





Latest Courses