🔰property enumeration
enumerate through properties of an object.
| ✅:string / symbol | 🔤:String | 🔺:Symbol
method/operator | own enum | own nonenum | inherited enum | inherited nonenum |
---|---|---|---|---|
✅ | ||||
✅ | ||||
🔤 | ||||
🔤 | 🔤 | |||
🔺 | 🔺 | |||
✅ | ✅ | |||
.hasOwn() | ✅ | ✅ | ||
✅ | ✅ | |||
for-in (loop over keys) | 🔤 | 🔤 | ||
for-of (loop over values) | 🔤 | 🔤 |
📘 MSN
Every property in JavaScript objects can be classified by 3 factors:
enumerable / non-enumerable
own / inherited (from the prototype chain)
📘 MSN
a property will not be enumerated if
a property by that same name has already been enumerated
a non-enumerable property by that same name has already been considered
Last updated