Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

react conditional array item

const arr = [
  ...(cond ? ['a'] : []),
  'b',
];
 
PREVIOUS NEXT
Tagged: #react #conditional #array #item
ADD COMMENT
Topic
Name
1+1 =