-
Notifications
You must be signed in to change notification settings - Fork 1
fromIterator
Subhajit Sahu edited this page Feb 3, 2021
·
4 revisions
Convert an iterator to iterable.
Alternatives: from, fromIterator, fromRange, fromInvocation, fromApplication.
Similar: isIterator, iterator, from.
function fromIterator(x)
// x: an iterator/iterable
const xiterable = require('extra-iterable');
var x = [1, 2].xiterable.values();
var xi = x[Symbol.iterator]();
[...xiterable.fromIterator(xi)];
// → [1, 2]