JavaScript · Language basics
for…in
Iterates enumerable property names, including inherited ones. Use Object.keys for own keys only.
Syntax
for (const key in object) { … }Example
Try it
More in this group
Learn this in the course
Reference pages are the quick answer. The course explains the why, shows the full example and ends with a challenge.