Answers for "conditional array element js"

3

js conditional array element

const cond = false;
const arr = [
  ...(cond ? ['a'] : []),
  'b',
];
    // ['b']
Posted by: Guest on October-27-2020
1

conditional array element js

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

Code answers related to "Javascript"

Browse Popular Code Answers by Language