You have seen the pattern in the demo. Now write the program yourself in script.js. Keep the focus on values, conditions, loops, arrays, or functions—not page elements.
For a different collection, read every value rather than hard-coding a position:
const miles = [2, 4, 6];
let total = 0;
for (const mile of miles) total += mile;
console.log(total / miles.length); // 4
scores array containing 84, 91, and 76.courseAverage(scores) to return the average of all values.topScore(scores) to return the largest value.Average: 83.66666666666667 | Top: 91.Run your code after each small change. The Console should show one clear summary once all checks pass.
Start with the smallest function signature, then test one case at a time.