JSFiddle - React, Tailwind, and code Playground
JavaScript
let arr = ['foo','bar', 'baz'];
let otherArr = [];
let mapArr = arr.map((item) => {
return `-- ${item} --`;
});
arr.map((item) => {
otherArr.push(`~~ ${item} --`);
});
console.log('mapArr', mapArr);
console.log('otherArr', otherArr);