Object.values
suggest changeThe Object.values() method returns an array of a given object’s own enumerable property values, in the same order as that provided by a for…in loop (the difference being that a for-in loop enumerates properties in the prototype chain as well).
const obj = { 0: 'a', 1: 'b', 2: 'c' };
console.log(Object.values(obj)); // ['a', 'b', 'c']
Note:
Object.values() includes only own enumerable string-keyed properties. It omits symbol-keyed and non-enumerable properties.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents