I am trying to add 2 to given array. But the code returns undefined when run. I am trying to learn ES6, I couldn't find the problem. I need help.
const mapSomething = (arr) => {
arr.map(n => {
return n + 2;
})
}
// It have to return [3, 4, 5] but it returns undefined
console.log(mapSomething([1, 2, 3]));