Skip to content

Latest commit

 

History

History
52 lines (49 loc) · 1.32 KB

enumerating-properties.md

File metadata and controls

52 lines (49 loc) · 1.32 KB

Enumerating Properties

METHOD ALGORITHM ONLY OWN KEYS NON-ENUMERABLE KEYS KEYS ORDER
Reflect.ownKeys() [[OwnPropertyKeys]] YES YES standard-compatible
Object.getOwnPropertyNames()
Object.getOwnPropertySymbols()
Object.keys() [[OwnPropertyKeys]]
+ filtering
+ sorting
YES NO based on an implementation
JSON.stringify()
Reflect.enumerate() [[Enumerate]] NO NO based on an implementation
for...in

[[GetOwnPropertyKeys]] Algorithm

  1. numeric keys are fetched in the ascending order
  2. text keys are fetched in a order they were being created
  3. symbols are fetched in a order they were being created