Tell us what’s happening:
I keep failing the tests on use the reduce method to analyze data, despite using the
reduce method. It even failed when I pasted in the solution code.
Your code so far
// Only change code below this line var averageRating = watchList .filter(movie => movie.Director == "Christopher Nolan") .map(movie => Number(movie.imdbRating)) .reduce((sumRat, rating) => sumRat + rating) / watchList.filter(movie => movie.Director === "Christopher Nolan").length; // Only change code above this line return averageRating; }
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 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36 Edg/90.0.818.62.
Challenge: Use the reduce Method to Analyze Data
Link to the challenge: