Skip to content

Instantly share code, notes, and snippets.

@roine
Created December 5, 2014 02:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roine/7b0df2c5dcc56278314a to your computer and use it in GitHub Desktop.
Save roine/7b0df2c5dcc56278314a to your computer and use it in GitHub Desktop.
Notes on ES6
var numbers = ['a', 'b', 'c'];
for(let i of numbers){
console.log(i); // a b c
}
var users = [{
firstname: 'jon',
lastname: 'dem'
},
{
firstname: 'sophie',
lastname: 'wang'
}];
for({firstname} of users){
console.log(firstname); //jon wang
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment