Đăng Khánh
New member
What will be the output of the following JavaScript code?
A. 70
B. 75
C. 10
D. error
Code:
int sum=0;
var arr = [10,15,20,30];
arr.forEach(function myFunction(element)
{
sum= sum+element;
});
document.writeln(sum);
B. 75
C. 10
D. error