The Score Summation

EasyAcc. 98.5%
+15 XP 5

Total Accumulation

In data processing, summing a list of values is the most fundamental operation.

The Assignment

Your function receives an array parameter scores.

  1. Initialize a variable total to 0.
  2. Use a for loop to iterate through every element in the scores array.
  3. In each step, add the current score to total.
  4. Print the final total.

01EXAMPLE 1

Inputscores = [5, 12, 8, 15]
Output40

Explanation: 5 + 12 + 8 + 15 = 40.

Constraints

  • Use a manual for loop.
  • Do not use .reduce().
ArraysLoopsBasics
JavaScript
Loading...
3 Hidden

Input Arguments

scores[5,12,8,15]

Expected Output

40

Click RUN to test your solution