News for hackers. Stuff that matters.
Re:The triple dot syntax (` `) in JavaScript: rest vs. spread by archduck on Monday May 09, 2022 @01:43AM (#31311003)
This ain’t pretty, but it works:

  [
    “foo”,
    ...(cond1 ? [bar] : []),
    ...(cond2 ? baz : []),
  ]
---

Edit: note to self: read the link before commenting.

There are no comments on this comment yet.