Given an array of numbers, loop through the array and print each number until you encounter a negative number. At the end, print the sum of all numbers traversed.
Note: use a while loop
For eg.
function printUntilNegative(numbers){
// write your code here
}
let numbers = [1,2,0,6,8,-1,2,-4];
printUntilNegative(numbers);
should print
1
2
0
6
8
17