1
Good morning guys, I have an array, however I only want to multiply the array index 2 using .map()
. Below is an example where I am multiplying all array positions.
const nums = [1,2,3,4,5]
let result = nums.map(function(e, i, arr) {
return e * 2
})
console.log(result)
How to modify position 2 only?
Please check the replies and tick one as the response to your post ...
– novic