Answer the question
In order to leave comments, you need to log in
Trying to find the sum of the array elements (with the value entered from the screen). Why am I getting NaN?
var mas=[];
sum=0;
for (var i =1; i < 4; i++) {
mas.push(prompt("element №" + i));
sum = sum + parseInt(mas[i]);
alert(mas);
alert(sum);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question