OptionalthisArg: anyTypeError when it is created if the value's [Symbol.iterator] isn't null, undefined or a function, from
its next() (the iterator isn't checked when it is created) when the value's [Symbol.iterator]() doesn't return an
iterator or the source's next() returns a value which is not an object, from its return() when the source's
return() returns a value which is not an object, and when its next() or return() is called by the callbackfn
Creates a lazily mapped iterable iterator. The value is processed like
for...of(and iterForOf), so an iterable (including a string or an array) is processed using its iterator (a string by its code points on a runtime which supportsSymbol.iterator) and an iterator which is not iterable is used as-is. Unlikefor...of(and iterForOf, which only also processes an array) any other array-like which is not iterable (eg.{ length: 2, 0: "a", 1: "b" }, orargumentsor a string on a runtime withoutSymbol.iterator) is processed using its indexes. AMaporSetwhich is not iterable (eg. on IE 11) is processed using a copy of its[key, value]entries / values, which is made when this is called (rather than when the first value is read), so a value added after that is not processed. Like the native iterator helpers a TypeError is thrown when the source'snext()returns a value which is not an object, the source is closed (by calling itsreturn()with no arguments) when the callbackfn throws, it is done once the source or the callbackfn throws, itsreturn()only closes the source when it isn't already done, and a TypeError is thrown when itsnext()orreturn()is called by the callbackfn.