Last active
March 23, 2016 01:52
-
-
Save lricoy/94375e4f81afdf9573d4 to your computer and use it in GitHub Desktop.
ES2015 features
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
// Expressões (Expression bodies) | |
var odds = evens.map(v => v + 1); | |
var nums = evens.map((v, i) => v + i); | |
// Declarações (Statement bodies) | |
nums.forEach(v => { | |
if (v % 5 === 0) | |
fives.push(v); | |
}); | |
// Referência léxica ao *this* (Lexical this) | |
var bob = { | |
_name: "Bob", | |
_friends: [], | |
printFriends() { | |
this._friends.forEach(f => | |
console.log(this._name + " knows " + f)); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment