Create a calculator for the entered values.
Write a code that:
- Queries the values in turn using the prompt and saves them in an array.
Ends input as soon as the visitor enters a blank line, not a number, or clicks Cancel.
At the same time zero 0 should not finish the input, this is a permitted number.
Displays the sum of all array values.
(function() { var arr = [], res = 0, calc; do { calc = +prompt('Введите число', ''); if (calc == '' || calc == null || isNaN(calc)) break; arr.push(calc); } while (true); for (var i = 0; i < arr.length; i++) { res += arr[i]; } return res; })() How to fulfill the third condition ??