Skip to content

Instantly share code, notes, and snippets.

@erikzaadi
Created October 22, 2018 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erikzaadi/7b29964784f67139f8e56bc87aa5563f to your computer and use it in GitHub Desktop.
Save erikzaadi/7b29964784f67139f8e56bc87aa5563f to your computer and use it in GitHub Desktop.
Nested Destructuring
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