Object.values()

const object1 = {
  a: 'somestring',
  b: 42,
  c: false
};

console.log(Object.values(object1));
// Expected output: Array ["somestring", 42, false]

Description

Returns the values in an array of each Object entry. This is the same as using a for...in loop.

Parameters

obj

Return Value

Array of the values of each entry in the passed object

Example

I have used this method within the 49 Group Anagrams problem, where I used it to return the previously created arrays of anagrams contained in a hashmap.

References

49 Group Anagrams
for...in
Object.keys()