arr = new Array();
var sum = 0;
var i = 0;
while(true) {
var number = prompt("Введите число", 0);
if (number == null || number == "" || !isFinite(number)) {
break;
} else {
arr.push(+number);
sum += arr[i];
}
i++;
}
console.log(sum)