Shameless plug, I introduced an ECMA proposal for a conditional rest and spread operator a few months ago and would appreciate support or suggestions if you would find it useful.
https://es.discourse.group/t/conditionally-add-elements-to-d...
https://es.discourse.group/t/conditionally-add-elements-to-d...
[
"foo”,
if (cond1) bar,
if (cond2) ...baz,
]
Pretty sure it was already proposed and rejected, but still. [
“foo”,
...(cond1 ? [bar] : []),
...(cond2 ? baz : []),
]
---Edit: note to self: read the link before commenting.
Q - is it just a matter of liking posts on tc39 discourse to show support?