Last active
November 16, 2016 16:30
-
-
Save bultas/d9fb5f42c3ef121706b1300d1fe337b7 to your computer and use it in GitHub Desktop.
ES6 Awesomeness (;
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
// DESTRUCTURING | |
// http://www.2ality.com/2015/01/es6-destructuring.html | |
let obj = { first: 'Jane', last: 'Doe' }; | |
let { first: f, last } = obj; | |
// f = 'Jane'; last = 'Doe' | |
// Array FIND/FINDIndex | |
// https://davidwalsh.name/es6-features | |
let ages = [12, 19, 6, 4]; | |
let firstAdult = ages.find(age => age >= 18); // 19 | |
let firstAdultIndex = ages.findIndex(age => age >= 18); // 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment