Last active
February 20, 2017 16:40
-
-
Save yefremov/2ca3ebbfe30dafbf00254ba5a94e8ddd to your computer and use it in GitHub Desktop.
Revisions
-
yefremov revised this gist
Feb 20, 2017 . No changes.There are no files selected for viewing
-
yefremov created this gist
Feb 20, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ function iterate(iterable) { var index = -1; return function next() { return ++index < iterable.length ? iterable[index] : null; } }; function makeIterator(iterable) { var index = -1; return function next() { return ++index < iterable.length ? { value: iterable[index], key: index, next: next, done: false } : { done: true }; }; }