P E N C I L
Login
Javascript: For...in vs For...of
What are for...in and for...of ?


For...in: 
All property of object and parent object.
For array: properties are index 0, 1, 2... and custom properties
For literal object: properties are custom properties
>> SHOULD NEVER BE USED : as it can list the properties of Object prototype

For...of:
For array: only values
For literal object: nothing 

How do we iterate a map ?
- Use Map.getEntries(), map.getKeys()
- Use Object.keys(LiteralObject)