reaguj element tablicy warunkowej

const arr = [
  ...(cond ? ['a'] : []),
  'b',
];
Lucas Charvolin