DEV Community

Discussion on: How I learned to Stop Looping and Love the Iterator

Collapse
 
dance2die profile image
Sung M. Kim

Thanks @kepta for the wonderful article.
I am able to see "why" iterators be so useful with those 4 "superpowers" 😀

Regarding iterator vs iterables, the way I understood is that,

  1. iterables are objects that can be iterated over
  2. so that means iterable objects return an iterator object with which we can iterate.

Did I understand it correctly?

Collapse
 
kepta profile image
Kushan Joshi

You got that damn right !

Collapse
 
dance2die profile image
Sung M. Kim

Thanks Kushan 👍