Iterables and Iterators in JavaScript

Iterables and Iterators in JavaScript

The iterable protocol was introduced to JavaScript in ES2015, and it allows us to define custom iteration behavior on objects so that we can control what values are looped over in a for...of loop, which was also introduced in ES2015.

[…]

Not familiar with the new Set class? Read my other post An Introduction to Sets in JavaScript.

[…]