how to put data from one array to another in js on conditional 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']