# Sum All Primes: Change solution

**URL:** <https://forum.freecodecamp.org/t/sum-all-primes-change-solution/414175>\
**Category:** freeCodeCamp Contributors\
**Tags:** contributing\
**Created:** [August 8, 2020, 2:12am UTC](https://forum.freecodecamp.org/t/sum-all-primes-change-solution/414175 "2020-08-08T02:12:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ohalexhana](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ohalexhana/32/169525_2.png) [@ohalexhana](https://forum.freecodecamp.org/u/ohalexhana)\
**Post date:** [August 8, 2020, 2:12am UTC](https://forum.freecodecamp.org/t/sum-all-primes-change-solution/414175/1 "2020-08-08T02:12:12Z")

</div>

Hi there! I think we need to add Solution 3 by adding in “let” next to the for statement. I’m not sure if it’s a for statement or function or what to call it… See below:

When I copied and paste Solution 3 from here – [freeCodeCamp Challenge Guide: Sum All Primes](https://forum.freecodecamp.org/t/freecodecamp-challenge-guide-sum-all-primes/16085) into the lesson here – [https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/sum-all-primes](https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/sum-all-primes)

It wouldn’t work.

So, I added let into the code (after the for, in front of the i)…

> ****
>
> ```auto
> function sumPrimes(num) {
> function isPrime(number) {
> for (let i = 2; i <= number; i++)
> 
> ```

---

<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:** [June 1, 2021, 6:32pm UTC](https://forum.freecodecamp.org/t/sum-all-primes-change-solution/414175/2 "2021-06-01T18:32:31Z")

</div>

Closed on June 1, 2021, 6:32pm UTC


