tc39 / proposal-logical-assignment

A proposal to combine Logical Operators and Assignment Expressions
https://tc39.es/proposal-logical-assignment/
MIT License
300 stars 13 forks source link

Destructing #29

Open huczk opened 4 years ago

huczk commented 4 years ago

Hi, i have a question regarding destructing, will this new assignments work while destructing? this can be very handy for example 😄 :

const { a ??= "value" } = someVariable.

Current default assign while destructing only checks for undefined so nullish check can help a lot

hax commented 4 years ago

I remember this was discussed before and could be a follow-on proposal.