What does `Reflect.ownKeys(obj)` return compared to `Object.keys(obj)`?

JavaScript Developer Hard

JavaScript Developer — Hard

What does `Reflect.ownKeys(obj)` return compared to `Object.keys(obj)`?

Key points

  • Reflect.ownKeys includes non-enumerable and Symbol keys
  • Object.keys only returns enumerable string keys
  • Reflect.ownKeys is more comprehensive
  • Object.keys is limited to specific types of keys

Ready to go further?

Related questions