how to refer to the array when using javascript map function code example
Example 1: javascript map array
const sweetArray = [2, 3, 4, 5, 35]
const sweeterArray = sweetArray.map(sweetItem => {
return sweetItem * 2
})
console.log(sweeterArray)
Example 2: map a property from array of objects javascript
var result = objArray.map(function(a) {return a.foo;});