Last active
September 26, 2021 17:27
-
-
Save whitelizard/026414cbcc195eb6e73568d5b00ed6a4 to your computer and use it in GitHub Desktop.
Destructuring possibilities
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 func = ( | |
{ | |
fallbackMessage: msg = 'Unknown', | |
offset = 4, | |
pos: { x = 0, y = 0 } = {}, | |
...options | |
} = {}, | |
data = {}, | |
) => { | |
const { title = '', items: [head, ...tail] = [] } = data; | |
// some nice logic | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment