3 ms·
This ain’t pretty, but it works: [ “foo”, ...(cond1 ? [bar] : []), ...(cond2 ? baz : []), ] --- Edit: note to self: read the link before comm
by archduck 4y ago
This ain’t pretty, but it works:
[
“foo”,
...(cond1 ? [bar] : []),
...(cond2 ? baz : []),
]
---
Edit: note to self: read the link before commenting.