Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@deepak
Created February 14, 2017 08:12
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 deepak/e08a966e8103343d86adea637d2fc437 to your computer and use it in GitHub Desktop.
Save deepak/e08a966e8103343d86adea637d2fc437 to your computer and use it in GitHub Desktop.
deep destructuring in ES6
const params = {
pagination: {
prevId:1,
nextId: 3
},
location: {
query: {
step: 10
}
}
};
const {
pagination: { prevId, nextId },
location: { query: { step = 1 } }
} = params;
console.log({prevId, nextId, step});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment