Category
Returns an iterable that uses a provided iterator.
Time complexity: O(1)
Space complexity: O(1)
The iterator to convert to an iterable
An iterable that uses iterator
iterator
Iterable
const iterable = [1, 2, 3];const iterator = iterable[Symbol.iterator]();iteratorToIterable(iterator); // { [Symbol.iterator]: () => iterator } Copy
const iterable = [1, 2, 3];const iterator = iterable[Symbol.iterator]();iteratorToIterable(iterator); // { [Symbol.iterator]: () => iterator }
Returns an iterable that uses a provided iterator.
Time complexity: O(1)
Space complexity: O(1)