Skip to content

Instantly share code, notes, and snippets.

@ppraksa
Created March 24, 2017 13:28
Show Gist options
  • Save ppraksa/0818209ffcd8750a4ed0942edb5306c3 to your computer and use it in GitHub Desktop.
Save ppraksa/0818209ffcd8750a4ed0942edb5306c3 to your computer and use it in GitHub Desktop.
Symbol.iterator
let a = [1,2,3,4,5,6,7,8,9,0],
tmp = 0,
it = a[Symbol.iterator]();
do {
tmp = it.next();
if(tmp.value != undefined) {
console.log(`Value is: ${tmp.value}`);
}
} while(!tmp.done)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment