JS: Iterator.prototype

By Xah Lee. Date: . Last updated: .

What is Iterator.prototype

Allow all standard Iterable objects to have methods such as map, forEach, filter, etc, without having to convert to array first. Similarly, modify given Iterator to return a new iterator.

Properties

constructor

value is Iterator

console.assert(Iterator.prototype.constructor === Iterator);
xtodo