Legacy iterator protocol has been removed

Published: | Categories: JavaScript


The support for the non-standard, legacy iterator protocol, introduced with JavaScript 1.7, has been removed with Firefox 57. This includes the Iterator constructor and __iterator__ method.

ECMAScript 2015 (ES6) offers the iterable Array, Map and Set objects, and various DOM APIs are now also iterable, such as StyleSheetList (since Firefox 31), CSSRuleList (since Firefox 32), URLSearchParams (since Firefox 44), FormData (since Firefox 44), Headers (since Firefox 44), NodeList and DOMTokenList (since Firefox 50).

Those objects can be used in conjunction with the for...of statement without the Iterator constructor. For generic, non-iterable objects, you can simply replace Iterator with the new, standard Object.entries method to make them iterable. See the standard iterators and generators for details.