Created
February 14, 2017 08:12
-
-
Save deepak/e08a966e8103343d86adea637d2fc437 to your computer and use it in GitHub Desktop.
deep destructuring in ES6
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
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