JS: Iterator (Abstract class)
What is the Keyword “Iterator”
Has property Iterator.prototype that is the parent of all builtin Iterator, so Iterable Object can directly use methods like forEach, map, etc.
Properties
from
lengthname
console.log(Reflect.ownKeys(Iterator)); // [ "length", "name", "prototype", "from" ] console.log(Iterator.from); // [Function: from] console.assert(Iterator.length === 0); console.assert(Iterator.name === "Iterator");