Functional Programming - Use the reduce Method to Analyze Data

I used this method to solve the problem but it came out " Your code should return the correct output after modifying the watchList object."
I don’t really understand why?
Here’s the link.

function getRating(watchList) {
  // Only change code below this line
  let firList = watchList.filter(item => item.Director == "Christopher Nolan");
  let secList = firList.map(item => Number(item.imdbRating));
  let averageRating = secList.reduce((ave, rating) => ave + rating / 4, 0)
  // Only change code above this line
  return averageRating;
}

Welcome to the forum. please provide link to the task

If it says “Your code should return the correct output with a different watchList object” would it be easier to understand what is the issue?

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.