# Christopher Nolan average rating

**URL:** <https://forum.freecodecamp.org/t/christopher-nolan-average-rating/450698>\
**Category:** Curriculum Help\
**Tags:** javascript\
**Created:** [March 11, 2021, 8:26pm UTC](https://forum.freecodecamp.org/t/christopher-nolan-average-rating/450698 "2021-03-11T20:26:31Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![saidingige](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/saidingige/32/184383_2.png) [@saidingige](https://forum.freecodecamp.org/u/saidingige)\
**Post date:** [March 11, 2021, 8:26pm UTC](https://forum.freecodecamp.org/t/christopher-nolan-average-rating/450698/1 "2021-03-11T20:26:31Z")

</div>

**Tell us what’s happening:**

i cant pass the test

**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.

````auto

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) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.36`.

**Challenge:** Use the reduce Method to Analyze Data

**Link to the challenge:**

> **[freeCodeCamp.org](https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/functional-programming/use-the-reduce-method-to-analyze-data)**
>
> Learn to Code — For Free

---

<div class="post-metadata">

**Author:** ![JeremyLT](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/jeremylt/32/291894_2.png) [@JeremyLT](https://forum.freecodecamp.org/u/JeremyLT)\
**Post date:** [March 11, 2021, 8:29pm UTC](https://forum.freecodecamp.org/t/christopher-nolan-average-rating/450698/2 "2021-03-11T20:29:07Z")

</div>

Can you please provide your code?

---

<div class="post-metadata">

**Author:** ![saidingige](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/saidingige/32/184383_2.png) [@saidingige](https://forum.freecodecamp.org/u/saidingige)\
**Post date:** [March 11, 2021, 8:33pm UTC](https://forum.freecodecamp.org/t/christopher-nolan-average-rating/450698/3 "2021-03-11T20:33:44Z")

</div>

> **[freeCodeCamp.org](https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/functional-programming/use-the-reduce-method-to-analyze-data)**
>
> Learn to Code — For Free

---

<div class="post-metadata">

**Author:** ![saidingige](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/saidingige/32/184383_2.png) [@saidingige](https://forum.freecodecamp.org/u/saidingige)\
**Post date:** [March 11, 2021, 8:36pm UTC](https://forum.freecodecamp.org/t/christopher-nolan-average-rating/450698/4 "2021-03-11T20:36:46Z")

</div>

[https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/functional-programming/use-the-reduce-method-to-analyze-data](https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/functional-programming/use-the-reduce-method-to-analyze-data)

---

<div class="post-metadata">

**Author:** ![JeremyLT](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/jeremylt/32/291894_2.png) [@JeremyLT](https://forum.freecodecamp.org/u/JeremyLT)\
**Post date:** [March 11, 2021, 8:40pm UTC](https://forum.freecodecamp.org/t/christopher-nolan-average-rating/450698/5 "2021-03-11T20:40:42Z")

</div>

We need to see your code, not a link to the challenge you are working on.

* * *

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.

 ![Pre-formatted-text](https://global.discourse-cdn.com/freecodecamp/original/3X/1/b/1b18854f1059217f29370444396145cc3a0cd8ae.gif)

See [this post](https://forum.freecodecamp.org/t/forum-code-formatting/25574) to find the backtick on your keyboard.  
**Note:** Backticks (`) are not single quotes (’).

---

<div class="post-metadata">

**Author:** ![saidingige](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/saidingige/32/184383_2.png) [@saidingige](https://forum.freecodecamp.org/u/saidingige)\
**Post date:** [March 11, 2021, 8:52pm UTC](https://forum.freecodecamp.org/t/christopher-nolan-average-rating/450698/6 "2021-03-11T20:52:09Z")

</div>

```auto
function getRating(watchList){

  var averageRating = watchList

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

  .map(film => Number(film.imdbRating))

  .reduce((sumOfRatings, rating) => sumOfRatings + rating)

  watchList.filter(film => film.Director === "Christopher Nolan").length;

  

  return averageRating;

}

console.log(getRating(watchList));

```

---

<div class="post-metadata">

**Author:** ![JeremyLT](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/jeremylt/32/291894_2.png) [@JeremyLT](https://forum.freecodecamp.org/u/JeremyLT)\
**Post date:** [March 11, 2021, 8:58pm UTC](https://forum.freecodecamp.org/t/christopher-nolan-average-rating/450698/7 "2021-03-11T20:58:21Z")

</div>

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.

 ![Pre-formatted-text](https://global.discourse-cdn.com/freecodecamp/original/3X/1/b/1b18854f1059217f29370444396145cc3a0cd8ae.gif)

See [this post](https://forum.freecodecamp.org/t/forum-code-formatting/25574) to find the backtick on your keyboard.  
**Note:** Backticks (`) are not single quotes (’).

---

<div class="post-metadata">

**Author:** ![JeremyLT](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/jeremylt/32/291894_2.png) [@JeremyLT](https://forum.freecodecamp.org/u/JeremyLT)\
**Post date:** [March 11, 2021, 8:59pm UTC](https://forum.freecodecamp.org/t/christopher-nolan-average-rating/450698/8 "2021-03-11T20:59:37Z")

</div>

I believe that you may be missing a division operation in there.

---

<div class="post-metadata">

**Author:** ![saidingige](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/saidingige/32/184383_2.png) [@saidingige](https://forum.freecodecamp.org/u/saidingige)\
**Post date:** [March 11, 2021, 9:07pm UTC](https://forum.freecodecamp.org/t/christopher-nolan-average-rating/450698/9 "2021-03-11T21:07:57Z")

</div>

thanks for informing me about the backticks. please show me how to do the divisional operation

---

<div class="post-metadata">

**Author:** ![JeremyLT](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/jeremylt/32/291894_2.png) [@JeremyLT](https://forum.freecodecamp.org/u/JeremyLT)\
**Post date:** [March 11, 2021, 9:15pm UTC](https://forum.freecodecamp.org/t/christopher-nolan-average-rating/450698/10 "2021-03-11T21:15:02Z")

</div>

I’m not sure if you fully understood the code you wrote. Can you describe, in words, what your code is doing? If you can describe your code, line by line, in words, then you will be able to see where you need to divide two quantities.

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [March 11, 2021, 9:15pm UTC](https://forum.freecodecamp.org/t/christopher-nolan-average-rating/450698/11 "2021-03-11T21:15:47Z")

</div>

> [@saidingige](#):
>
> `watchList.filter(film => film.Director === "Christopher Nolan").length;`

what is this doing on a line on its own?

---

<div class="post-metadata">

**Author:** ![saidingige](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/saidingige/32/184383_2.png) [@saidingige](https://forum.freecodecamp.org/u/saidingige)\
**Post date:** [March 11, 2021, 9:22pm UTC](https://forum.freecodecamp.org/t/christopher-nolan-average-rating/450698/12 "2021-03-11T21:22:16Z")

</div>

Thank you all I got it

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/freecodecamp/original/3X/e/1/e1c433102e34b46dfaa3e15d13ab9a514b127078.svg) [@system](https://forum.freecodecamp.org/u/system)\
**Post date:** [September 10, 2021, 9:23am UTC](https://forum.freecodecamp.org/t/christopher-nolan-average-rating/450698/13 "2021-09-10T09:23:02Z")

</div>

Closed on September 10, 2021, 9:23am UTC

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