Web Programming Discussion
Here is an example of a loop that I worked on for a worksheet in class. Loops were really difficult for me and took a lot of time and effort to finish.
const numbers = [2, 4, 2, 6, 5, 8, 2];
let total = 0;
for (let x = 0; x < numbers.length; x++) {
total = total + numbers[x];
}
console.log("The total is: " + total);