Object.entries()
Object.entries() is a JavaScript method in the Object category. Returns an array of key/value pairs. The syntax is Object.entries(obj). A typical example: Object.entries({a:1, b:2}) // [["a",1],["b",2]]. Another practical use — Transform object to array: const scores = { math: 90, science: 85, english: 95 } const entries = Object.entries(scores) console.log(entries) // [['math',90], ['science',85], ['english',95]] Its time complexity is O(n), which matters when it runs over large inputs. The TypeScript signature is (obj: T): [keyof T, T[keyof T]][]. A close sibling is Object.keys(), which returns an array of a given object's own enumerable property names. A close sibling is Object.values(), which returns an array of a given object's own enumerable property values. A close sibling is Object.assign(), which copies properties from source objects to a target. A close sibling is Object.create(), which creates a new object with a specified prototype. More about this category: Object methods for object manipulation — keys, values, assign, and more.