Correction Needed for "Solution 3" of "Functional Programming: Use the reduce Method to Analyze Data"

After creating my own solution, I read through the solutions for " Functional Programming: Use the reduce Method to Analyze Data" learn more ways or better ways of solving the challenge.

After reading and doing my best to understand “Solution 3,” I realized that the function returns “averageRating” which, at this point, is an object containing property value pairs:

return averageRating; which returns {sum: 34.7, count: 4}

If I’m correct, this is what the return statement should be:

return averageRating.sum / averageRating.count;

If I’m wrong, I apologize. :slight_smile:

But if I’m right, please let the person or people who are responsible for editing the code know so that they can make the correction. :slight_smile:

please add the links to what you are referring to, it is difficult to follow your correction if you don’t link anything

I copy-pasted Solution 3 into the challenge the solution passes. The solution also logs a number instead of an object.

You’re right. I must have missed something. Sorry.

Sorry for not including the link. But, it’s not needed now because I must have made an error when trying to type the solution up myself. Thank You for trying to help.