function getAverageRating(arr) {
let summedValue = arr.reduce((accumulator, currentValue) => currentValue + accumulator;)
let count = arr.length;
return summedValue / count;
}
I am getting an error with this code because I have a semicolon at the end of the arrow function that is being used as the reduce callback function. Once I remove the semicolon the error goes away.
Any explanation as to why the semicolon is not allowed?