conditionals in array code example Example: conditional array element js const cond = false; const arr = [ ...(cond ? ['a'] : []), 'b', ];