Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

How to add JSX elements in an array

const todo = ['Make bed', 'Brush teeth', 'Eat breakfast'];
 
const list = [];
for (const item in todo) {
   list.push(<li>{todo[item]}</li>)
};
 
PREVIOUS NEXT
Tagged: #How #add #JSX #elements #array
ADD COMMENT
Topic
Name
7+5 =