JS Bedingte Array -Element

const cond = false;
const arr = [
  ...(cond ? ['a'] : []),
  'b',
];
    // ['b']
Defiant Dragonfly