Created
October 13, 2016 18:06
-
-
Save emilong/16c6d7136eea1fceb650b72fd58c3a36 to your computer and use it in GitHub Desktop.
This file contains 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
// can destructure arrays | |
const [a, b] = [1,2]; // a = 1, b = 2 | |
// can destructure object keys | |
const { a } = { a: 3 }; // a = 3 | |
// even function parameters | |
function foo({ a }) { | |
console.log(a); | |
} | |
foo({ a: 4 }); // prints 4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment