class method Object.values

View source on GitHub →

Object.values(object) → Array
  • object (Object) – The object to pull values from.

Returns an array of the object's property values.

Note that the order of the resulting array is browser-dependent — it relies on the loop, for which the ECMAScript spec does not prescribe an enumeration order.

Also, remember that while property names are unique, property values have no such constraint.

// -> []
 Object.values({ name: 'Prototype', version: '1.6.1' }).sort();
// -> ['1.6.1', 'Prototype']