The ownKeys(target) method
The ownKeys trap is executed when we retrieve the own property keys using the Reflect.ownKeys(), Object.getOwnPropertyNames(), Object. getOwnPropertySymbols() and the Object.keys() methods. It takes only one parameter--that is, the target object.
The Reflect.ownKeys() method is similar to the Object.getOwnPropertyNames() method--that is, they both return the enumerable and non-enumerable property keys of an object.
They also both ignore the inherited properties. The only difference is that the Reflect. ownKeys() method returns both the symbol and string keys, whereas the Object. getOwnPropertyNames() method returns only the string keys.
The Object.getOwnPropertySymbols() method returns the enumerable and non-enumerable ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access