Skip to content

Instantly share code, notes, and snippets.

@bbaaxx
Last active November 18, 2017 23:08
Show Gist options
  • Select an option

  • Save bbaaxx/31e3fc818296991792d1a8fecc2179f2 to your computer and use it in GitHub Desktop.

Select an option

Save bbaaxx/31e3fc818296991792d1a8fecc2179f2 to your computer and use it in GitHub Desktop.
Code for blog post about iterators iterables and generators with ES6
const someArray = [2, 4, 8];
let someArraySquared = [];
for (let n of someArray) {
someArraySquared.push(n * n);
}
console.log(someArray, someArraySquared);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment