Zell Liew, just wanted to add my 2cents to this well written article.
I feel if one realises that a particular object would require a lot of iteration then maybe they need to start thinking about ditching the object in favour of data structures which have a first party support for iteration.
With ES6 we have a new fancy data structure called Map and it is a perfect fit for those cases where you are overloading an object with thousands of properties and also want to iterate through them.
Zell Liew, just wanted to add my 2cents to this well written article.
I feel if one realises that a particular
object
would require a lot of iteration then maybe they need to start thinking about ditching the object in favour of data structures which have a first party support for iteration.With ES6 we have a new fancy data structure called
Map
and it is a perfect fit for those cases where you are overloading an object with thousands of properties and also want to iterate through them.A simple example of
Map
.MDN Docs for Map
Thanks for adding on!