The spread syntax is for spreading any iterable - which a Set very definitely is. It is useful for way more than just Arrays or Strings - which TS seems to insist it be one of.
More than a decadeΒ΄ of experience as a software developer. Software architecture, team coaching, working with all technologies and on all platforms used for web-facing products.
More than a decadeΒ΄ of experience as a software developer. Software architecture, team coaching, working with all technologies and on all platforms used for web-facing products.
The spread operator doesn't work with typescript and
Setsince the type it returns isn't an array, so that's why I did that in this post.If you're not using ts, the spread operator can absolutely be used.
Thank god I don't use TS.
The spread syntax is for spreading any iterable - which a Set very definitely is. It is useful for way more than just Arrays or Strings - which TS seems to insist it be one of.
High five ππ½. I'm one of the rare ones who avoid TS at all costs. No need to make our lives harder as devs just to get on the bandwagon.
That's not true, here is a running example of just that: typescriptlang.org/play?#code/MYew...
Not a fan of TS, but is this a recent addition? I tried a TS repl (replit.com/languages/typescript) and got this:
Huh, interesting. TIL!