reagieren Sie das bedingte Array -Element
const arr = [
...(cond ? ['a'] : []),
'b',
];
Lucas Charvolin
const arr = [
...(cond ? ['a'] : []),
'b',
];