Answers for "js conditional object in array"

1

js conditional object in array

const cond = false;
const arr = [
  ...(cond ? ['a'] : []),
  'b',
];
Posted by: Guest on January-24-2021

Code answers related to "js conditional object in array"

Code answers related to "Javascript"

Browse Popular Code Answers by Language