Last active
January 1, 2018 17:16
-
-
Save kevinchisholm/02731479f9675b2dc31c4b7564ef8421 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
var a, b; | |
[a, b] = ['foo', 'bar']; | |
console.log(a); // foo | |
console.log(b); // bar |
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
var [a, b] = ['foo', 'bar']; | |
console.log(a); // foo | |
console.log(b); // bar |
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
var [a, b, ...restOfArray] = ['foo', 'bar', 'monday', 'tuesday', 'wednesday']; | |
console.log(a); // foo | |
console.log(b); // bar | |
console.dir(restOfArray); // ['monday', 'tuesday', 'wednesday'] |
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
var {a, b} = {a: 'hello', b: 'godbye'}; | |
console.log(a); // hello | |
console.log(b); // godbye |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment