-
Notifications
You must be signed in to change notification settings - Fork 1
from
Subhajit Sahu edited this page Jul 7, 2020
·
25 revisions
Converts iterator to iterable. 🏃 📼 📦 🌔 📒
Alternatives: from, fromRange, [fromCall], fromApply.
Similar: isIterator, iterator, from.
iterable.from(x);
// x: an iterator/iterable
const iterable = require('extra-iterable');
var x = [1, 2].values();
var xi = x[Symbol.iterator]();
[...iterable.from(xi)];
// [ 1, 2 ]