Reduce method challenges

Tell us what’s happening:

ok so im stuck just on the filter part. i wrote the code to filter all movies by christopher nolan and i get returned a blank array.

Your code so far


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.

line above and the

Your browser information:

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

Challenge: Use the reduce Method to Analyze Data

Link to the challenge:

Please paste in your code so we can see what’s going on. Thanks.

var averageRating=watchList.filter(film => film.Director===“Christoper Nolan”)

Is that your entire code? We need to see your entire function.

function getRating(watchList){

  // Only change code below this line

  var averageRating=watchList.filter(film => film.Director==="Christoper Nolan")


  // Only change code above this line

  return averageRating;

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).

this much code is enough to filter out only movies directed by Christopher Nolan. I would check for typos then restart the browser. Sometimes it’s the browser and not your code. Good luck!

It looks like you have a typo in the name: "Christopher Nolan"

Once you fix that, you’ll still need to turn the result from the filter into an average rating value.

oh oops, thanks alot . ill see where i go ffrom here.


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