TIL to destructure a parent and its child at the same time in JS
const {
parent,
parent: { child },
} = something
There are real reasons that syntax isn’t intuitive. 10,000 times I wanted to do this…
TIL to destructure a parent and its child at the same time in JS
const {
parent,
parent: { child },
} = something
There are real reasons that syntax isn’t intuitive. 10,000 times I wanted to do this…