Object.entriesbeginner// Get [key, value] pairs of an object
const obj = { a: 1, b: 2 }
Object.entries(obj) // β [['a', 1], ['b', 2]]Use Object.entries() to get an array of [key, value] pairs for iterating over an object's own enumerable properties.
Object.entries only returns own and enumerable properties β inherited or non-enumerable ones are excluded.
Challenge: Implement countEntries(obj) that returns the number of own enumerable entries.
countEntries({ a: 1, b: 2 }) // β 2