JavaScript Object.values() Method

The Object.values() returns an array which contains the given object's own enumerable property values, in the same order as that provided by a for...in loop.

Syntax:

Parameter:

obj: It is the object whose enumerable own property values are to be returned.

Return value:

This method returns an array of a given object's own enumerable property value.

Browser Support:

Chrome54
Edge14
Firefox47
Opera41

Example 1

Output:

["Rahul", 0, false]

Example 2

Output:

 ["string", 34, true] 
["string", 34, true]

Example 3

Output:

[1, 2, 3]





Latest Courses