Demystifying Iterables by implementing a python like range function
5 min readMay 26, 2021
With ES6, we got introduced to the concept of Iterables. Iterating over an array using a for-in loop or a for-of loop is not new to us.
We have all done something like this at least once in our codebase:
But what if you would want to have that same functionality of iterating over something that is not an Array. How about an object?
In order to iterate over its values, we might have to use Object.values with a map.