array map arrow function js code example
Example 1: array map arrow function
materials.map((str) => {
const {length} = str;
return length;
});
Example 2: arrow function map js
const exampleArray = ['aa','bbc','ccdd'];
console.log(exampleArray.map(a => a.length));
//Would print out [2,3,4]