How would I add the sum of my array together using a loop and it would output only the sum of the array??
function exercise07Part1() {
//declare variables
const MAXIMUM_NUMBER = 10;
var someNumbers;
var sumOfNumbers;
var output;
var counter;
//assign 10 variables to the array
someNumbers = [12,67,90,34,32,67,29,74,49,22];
//assign variable to counter for the loop
counter = 1;
sumOfNumbers = 0;
while (counter <= someNumbers.length) {
sumOfNumbers += someNumbers[counter];
counter++;
}
output = document.getElementById('outputPart1');
output.innerHTML = "Array: [" + someNumbers + "]<br />Sum: " + sumOfNumbers;
}