Created
October 22, 2018 14:01
-
-
Save erikzaadi/7b29964784f67139f8e56bc87aa5563f to your computer and use it in GitHub Desktop.
Nested Destructuring
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 nestedOriginalObject = { | |
firstLevel: { | |
secondLevel: { | |
key1: 'value1', | |
key2: 'value2' | |
} | |
} | |
}; | |
const { firstLevel: { secondLevel: { key1, key2 } } } = nestedOriginalObject; | |
console.log(key1, key2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment