We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
ESNext
lib.esnext.d.ts
global Iterator class
Iterator.from([1, 2, 3, 4, 5]) .map(n => n + 1) .filter(n => n > 2) .drop(1) .take(2) .toArray() // [4, 5]
See also all the validation tests (working since Node.js 22.0.0) at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator#iterator_helpers
However, the following code should (ideally) continue working:
const customIterator: Iterator<number> = { next: () => ({ value: 42 }) };
⚙ Compilation target
ESNext
⚙ Library
lib.esnext.d.ts
Missing / Incorrect Definition
global Iterator class
Sample Code
See also all the validation tests (working since Node.js 22.0.0) at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator#iterator_helpers
However, the following code should (ideally) continue working:
Documentation Link