Re:JavaScript variables: var and let and const
by decentralised on Sunday March 08, 2020 @08:31AM
(#22517704)
How about this:
let attribute1, attribute2;
try {
({attribute1, attribute2} = getObject())
} catch (e) {}
Re:JavaScript variables: var and let and const
by madacol on Sunday March 08, 2020 @09:38PM
(#22522155)
wow, didn't know that!
So parenthesis are the trick, thanks!
Re:JavaScript variables: var and let and const
by decentralised on Monday March 09, 2020 @03:28AM
(#22523603)
No problem!
I usually solve that case with
But I'm just not satisfied with it, too many statements. And it gets really messy with many attributes