JS Warunkowy element tablicy

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