Object.values() vs Object.entries()
Object.values() and Object.entries() are both JavaScript Object APIs, and choosing between them is a common point of confusion. This page compares their syntax, parameters, return values, and typical use cases so you can pick the right one. Object.values(): Returns an array of a given object's own enumerable property values. Its syntax is Object.values(obj). Object.entries(): Returns an array of key/value pairs. Its syntax is Object.entries(obj). Example of Object.values(): Object.values({a:1, b:2}) // [1, 2]. Example of Object.entries(): Object.entries({a:1, b:2}) // [["a",1],["b",2]]. Read the full references for Object.values() and Object.entries() to see edge cases, time complexity, browser support, and the mistakes developers most often make with each. Other Object APIs worth comparing: Object.keys(), Object.assign(), Object.create(), Object.defineProperty(), Object.defineProperties(), Object.freeze(). Both belong to the Object category in the JS Reference documentation, which covers 29 entries in total. Try both in the JavaScript playground to see the behavioral difference live.