Created
October 25, 2016 01:50
-
-
Save matthieu-D/04cfd48069dd1c74774572b7e6b20d7c 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
const [ a, b, c ] = [1,2,3]; | |
console.log(b) // 2 | |
const [ d, , f ] = [4,5,6]; | |
console.log(f); // 6 | |
const { id, surname, name } = {age:26, name: 'Matthieu'}; | |
console.log(name); // Only name is defined so: Matthieu | |
const { test='Default value'} = {}; | |
console.log(test); | |
// Default value | |
const {address} = {address: {street: 'Here', city:'There'}}; | |
console.log(address); | |
// Object {street: "Here", city: "There"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment