Skip to content
Advertisement

Tag: object-destructuring

Can I destructure to multiple variables when at least one has already been declared, and at least one has not?

I’m aware that I can destructure an object or array to multiple variables, whether they are both already assigned or both unassigned, but is it possible to restructure to multiple variables together when at least one variable has already been declared, and at least one has not? 1. Both unassigned This works ✅ 2. Both assigned This also works ✅

Advertisement