JS: iterator-like object

By Xah Lee. Date: .

What is iterator-like object

iterator-like object is an Iterable Object but not in the prototype chain of Iterator.prototype.

history

in ECMAScript 2015 , Iterable Object were created, together with Iterator Object, as mechanism to make iterable work.

anything conforming to Iterator Interface is called an iterator.

after 10 years, it was realized that it's nice to have iterators belonging to an iterator class as their prototype. so in ECMAScript 2025, the Iterator (class) was created.