« Previous Next » Iterators and Generators bring the concept of iteration directly into the core language and provide a mechanism for customizing the behavior of for...of loops. For details, see also: Iteration protocols for...of function* and Generator yield and yield* In JavaScript an iterator is an object which defines a sequence and potentially a return value upon its termination. Specifically