does forEach returns a new array code example
Example: what foreach method returns in javascript
function double(arr) {
return arr.forEach(num => num*2);
}
console.log(double([1,2,3,4])) //undefined
function double(arr) {
return arr.forEach(num => num*2);
}
console.log(double([1,2,3,4])) //undefined