Found issue on "Use the reduce Method to Analyze Data" topic

Tell us what’s happening:
From the lesson as below link:

I already use reduce method as my code below but the result show “Your code should use the reduce method”. Even I copied the 1 solution from your hint, it still shows the same.

Your code so far

function getRating(watchList){
  let nolanmovie = watchList.filter((movie) => movie.Director === "Christopher Nolan")
  return nolanmovie
  .map((movie) => parseFloat(movie.imdbRating))
  .reduce((acc, rating) => acc + rating, 0)/nolanmovie.length
  return averageRating;
}
console.log(getRating(watchList));

WARNING

The challenge seed code and/or your solution exceeded the maximum length we can port over from the challenge.

You will need to take an additional step here so the code you wrote presents in an easy to read format.

Please copy/paste all the editor code showing in the challenge from where you just linked.


Replace these two sentences with your copied code.
Please leave the ``` line above and the ``` line below,
because they allow your code to properly format in the post.

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36.

Challenge: Use the reduce Method to Analyze Data

Link to the challenge:

We are aware of the bug and working on a solution. Safari is making the process of solving this bug harder than it needs to be.

1 Like

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