This blog post is outdated. Please read chapter “Iterables and iterators” in “Exploring ES6”.
This blog post is part of a series on iteration in ES6:
ECMAScript 6 introduces a new interface for iteration,
Iterable. This blog post explains how it works, which language constructs consume data via it (e.g., the new
for-of loop) and which sources provide data via it (e.g., arrays).