Skip to content

iterator

Subhajit Sahu edited this page Feb 3, 2021 · 17 revisions

Get iterator of an iterable.

Similar: isIterator, iterator, from.


function iterator(x)
// x: an iterable
const xiterable = require('extra-iterable');

xiterable.iterator([1, 2]);
// Object [Array Iterator] {}

xiterable.iterator(new xiterable.Set([1, 2]));
// → [Set Iterator] { 1, 2 }


References

Clone this wiki locally