Round 1 of 3 · Score 0
This function should return the sum of an array. Which line is wrong?
function sum(nums) {
let total = 0;
for (let i = 0; i <= nums.length; i++) {
total += nums[i];
}
return total;