I avoid nested destructuring, especially when declaring defaults


I avoid nested destructuring, especially when declaring defaults. It requires the reader to carefully group curly braces.

Can you confidently and quickly read this?

function enroll({ history, location: { state: { payeeId } = {} } = {} })

Ouch. I can't.🤯

#javascript

View original on X