reaksi item array bersyarat

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