Created
February 18, 2014 08:54
-
-
Save Poltergeist/9067138 to your computer and use it in GitHub Desktop.
This file contains 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
/* jshint esnext: true */ | |
var array = [1337, 1553, 1224], | |
i = 0, | |
l = list(), | |
item = l.next(); | |
function *list() { | |
for (var c = 0; c < array.length; c++) { | |
yield array[c]; | |
} | |
} | |
while (!item.done) { | |
console.log(item.value); | |
if (i % 2 === 0) { | |
array.push(i); | |
} | |
item = l.next(); | |
i++; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment