array conditional value code example
Example: js conditional array element
const cond = false;
const arr = [
...(cond ? ['a'] : []),
'b',
];
// ['b']
const cond = false;
const arr = [
...(cond ? ['a'] : []),
'b',
];
// ['b']