Answer the question
In order to leave comments, you need to log in
Why does the Uncaught SyntaxError: Unexpected identifier error pop up?
Hello. Do not throw stones, I'm just learning) In general, I'm trying to create a simple function that will find the sum of the array elements. But the browser displays an error on line 1. Here is the code:
Function sumArray(arr) {
var sum = 0;
for (var i = 0; i < arr.length; i++) {
sum += arr[i];
}
return sum;
}
let array = [1,2,3,4,5,6,7];
alert(sumArray(array));
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question