Object.getOwnPropertyNamesintermediate// Get all own property names, including non-enumerable
const obj = { a: 1 }
Object.defineProperty(obj, 'hidden', { value: 2, enumerable: false })
Object.getOwnPropertyNames(obj) // β ['a', 'hidden']Use Object.getOwnPropertyNames() to list all own properties including non-enumerable ones, unlike Object.keys().
Object.keys returns only enumerable properties. Object.getOwnPropertyNames returns all own string-keyed properties regardless of enumerability.
Challenge: Implement extraNames(obj) that returns property names that are in getOwnPropertyNames but NOT in Object.keys (i.e. non-enumerable names).
// obj has 'a' (enumerable) and '_h' (non-enumerable)
extraNames(obj) // β ['_h']