What value is printed when executing the following code?
let sum = 0;
const arr = [1, 2, 3];
arr.forEach(element => {
sum += element;
});
console.log(sum);
What value is printed when executing the following code?
let sum = 0;
const arr = [1, 2, 3];
arr.forEach(element => {
sum += element;
});
console.log(sum);