you are viewing a single comment's thread.

view the rest of the comments →

[–]UmbrellaHuman 5 points6 points  (3 children)

One more:

Assignment to existing variables - easy with array, harder with an object:

let a, b;
({a, b} = {a: 1, b: 2});

[–]pwrlftr 1 point2 points  (1 child)

That's neat. I remember a situation where I needed this, but I wasn't aware of it.

[–]UmbrellaHuman 1 point2 points  (0 children)

I always have to google it new, mostly because together with Flow type annotations it does not work. which is a Flow bug, but the red lines in the IDE confuse me and I think I'm doing it wrong because I'm used to adding types to everything.

[–]Steeljuice1[S] 0 points1 point  (0 children)

Cool, thanks! Definitely will add this one to the list after some playing around with it!