Last active
January 22, 2017 05:24
-
-
Save JasonCust/0cde7684af9bf97a49e9708ec4d8ef41 to your computer and use it in GitHub Desktop.
ES2015 Destructuring Assignment Example -- Basic object destructuring assignment with default value using a Dagwood Sandwich
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
let {bread, cheeses, condiments = ['mustard']} = dagwoodSandwich; | |
console.log({bread, cheeses, condiments}); | |
// output: { bread: 'rye', cheeses: ['cheddar'], condiments: ['mustard'] } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment