Skip to content
Subhajit Sahu edited this page May 11, 2020 · 25 revisions

Converts iterator to iterable. 🏃 📼 📦 🌔 📒

Similar: isIterator, iterator, from.

iterable.from(x);
// x: an iterator
const iterable = require('extra-iterable');

var x = [1, 2].values();
var xi = x[Symbol.iterator]();
[...iterable.from(xi)];
// [ 1, 2 ]

references

Clone this wiki locally