You are given an array of numbers called numbers. Calculate the sum of numbers and return it from the function. If the next number is 0, the program must stop processing the numbers and return the result.
Break and continue statements
The sum of numbers
Report a typo
Sample Input 1:
11 12 15 10 0 100Sample Output 1:
48Sample Input 2:
100 0 100Sample Output 2:
100Write a program in JavaScript
function sum(numbers) {
// write your code here
}
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.