Created
March 30, 2016 16:49
-
-
Save jweinst1/78d6d329dd8ce21257b8ad37e8e81479 to your computer and use it in GitHub Desktop.
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 characters
function makeIterator(array){ | |
var nextIndex = 0; | |
return { | |
next: function(){ | |
return nextIndex < array.length ? | |
{value: array[nextIndex++], done: false} : | |
{done: true}; | |
} | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment