JAVASCRIPT CLIMBSChapter 4 · JS Collections Depth
Object Keys & Values
To loop over or inspect the properties of an object, use Object.keys() (returns an array of keys) or Object.values() (returns an array of values).
Worked example
How it reads
- Object.keys(star) returns a list of string keys
- Object.values(star) returns a list of property values

Cloud tip: These methods allow you to use array methods like .map() or .forEach() on object data.


