Skip to content

Instantly share code, notes, and snippets.

@goldhand
Created May 17, 2016 15:39
Show Gist options
  • Save goldhand/16bf7307bd82174f2a33da1b086f90ed to your computer and use it in GitHub Desktop.
Save goldhand/16bf7307bd82174f2a33da1b086f90ed to your computer and use it in GitHub Desktop.
Example of destructuring deep objects in es6
let katdawg = {
kat: {
says: {
meow: '...'
}
},
dawg: {
bark: 'woof'
}
}
let { kat: { says: { meow } }, dawg: { bark } } = katdawg;
console.log(meow, bark);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment