I hope i am not replicating this conversation. This might be worth discussing if not clarifying something.
For question 7, I have noticed that many people have this on their code in their forum:
let ratingsSum = this.ratings.reduce((currentSum, rating) = > currentSum + rating);
While looking at the HINT part, Codecademy suggest this:
let ratingsSum = this.ratings.reduce((currentSum, rating) = > currentSum + rating, 0);
My question is with the 0. I know it stands for the currentIndex part of the .reduce() function, but why add the 0 when presumably the iteration will start with the first accumulator and then add the currentValue?
Does the 0 do any specific function to the .reduce()? if not, why mention it? The project walkthrough doesn’t mention or show the 0 in his function. Thanks in advance for the clarification.