JS Built-ins
ReflectownKeysbeginner

Reflect.ownKeys() - three keys

πŸ“– Usage Example
const obj = { a: 1, b: 2 }
const keys = Reflect.ownKeys(obj)
console.log(keys) // β†’ ['a', 'b']
// Includes string keys, Symbol keys, and non-enumerable keys

Reflect.ownKeys() returns an array of all own property keys (strings and Symbols) of an object.

Count own keys on a three-property object.

πŸ’‘ Hints (1)
  • β€’ .length on the result gives the count of own keys.