Saying nan can't find problem

Tell us what’s happening:

Your code so far

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; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36

Challenge: Use the reduce Method to Analyze Data

Link to the challenge:

HI @ezra1 !

Welcome to the forum!

Can you write your code directly in the forum?
It makes it easier for people to read instead of screenshots.

But at quick glance it looks like you have a typo on line 119

Tell us what’s happening:


function getRating(watchList) {

  // Only change code below this line

  var ratings = watchList

  .filter(item => item.Director === "Christopher Nolan")

  .map(item =>parseFloat(item.imdbRatig))

  var averageRating =ratings.reduce((a,b) => a + b) / ratings.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; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36

Challenge: Use the reduce Method to Analyze Data

Link to the challenge:

You still have this typo here
This is not the correct spelling

Once you fix that, then it will pass

1 Like

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