JS Built-ins
ObjectObject.keysintermediate

Object.keys() β€” non-enumerable properties

πŸ“– Usage Example
// Get array of own enumerable property names
const obj = { a: 1, b: 2, c: 3 }
Object.keys(obj)   // β†’ ['a', 'b', 'c']

Use Object.keys() to get an array of an object's own enumerable property names for iteration or counting.

Object.keys() β€” enumerable only

Properties defined with Object.defineProperty and enumerable: false are excluded from Object.keys() results.

Challenge: Understand how enumerability affects Object.keys().

πŸ’‘ Hints (1)
  • β€’ Object.keys only shows enumerable properties