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