Help me complete this example. Write output of the code after:?

Help me complete this example. Write output of the code after:?
0

#1

var numbers = [2, 4, 6, 8];
var counter = 0;
var sum = 0;
while (counter < numbers.length) {
sum += numbers[counter];
counter++;
}
console.log(sum);


#2

What are you expecting your code to do that it is not currently? You always need to explain what you expect vs. what happens. We do not know your expectations at this point.


#3

what is the out put of the following code?
var numbers = [2, 4, 6, 8];
var counter = 0;
var sum = 0;
while (counter < numbers.length) {
sum += numbers[counter];
counter++;
}
console.log(sum);


#4

Run the code and look at your browser’s console (Ctrl+Shft+J in Chrome) to see for yourself.