The sum of numbers

Report a typo

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.

Sample Input 1:

11 12 15 10 0 100

Sample Output 1:

48

Sample Input 2:

100 0 100

Sample Output 2:

100
Write a program in JavaScript
function sum(numbers) {
// write your code here
}
___

Create a free account to access the full topic