Created
May 7, 2019 13:07
-
-
Save anthonycoffey/3bf66d1d5b3d51bf169b645070bf3e39 to your computer and use it in GitHub Desktop.
JavaScript Object Destructuring Example 1
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
var user = { name: 'Bill', age: 31, city: 'Dallas', state: 'TX' } | |
// object destructuring | |
var {city, state} = user; | |
console.log(city, state); // "Dallas", "TX" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment