I wrote an article about JavaScript iterators
I'm writing articles as a way to deepen my understanding of JS/TS and to help spread that knowledge. This one is all about iterators. I start with the snippet below and build up to custom iterators. Enjoy!
const arr = [1, 2, 3];
// `for...of` loops use iterators
for (const el of arr) {
// do something
}
Learn more here.