diff --git a/guide/english/certifications/javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/sum-all-primes/index.md b/guide/english/certifications/javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/sum-all-primes/index.md
index 864fe82534..b36ff5cdee 100644
--- a/guide/english/certifications/javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/sum-all-primes/index.md
+++ b/guide/english/certifications/javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/sum-all-primes/index.md
@@ -35,7 +35,7 @@ This problem is hard if you have to create your own code to check for primes, so
**Solution ahead!**
-##  Basic Code Solution:
+##  Basic Code Solution 1:
function sumPrimes(num) {
var res = 0;
@@ -86,6 +86,39 @@ This problem is hard if you have to create your own code to check for primes, so
* JS For Loops Explained
+##  Basic Code Solution 2:
+
+ function sumPrimes(num) {
+ let i = 1;
+ let sum = 0;
+ while(i <= num){
+ if(isPrime(i)){
+ sum += i;
+ }
+ i++;
+ }
+ return sum;
+ }
+ //function to check if a number is prime or not
+ function isPrime(x){
+ for(let i =2;i < x;i++){
+ if(x % i === 0) return false;
+ }
+ return x !==1 && x !== 0;
+ }
+ //test here
+ sumPrimes(10);
+ Run Code
+
+### Code Explanation:
+
+* Create a function to check if a number is prime or not.
+* Declare two variables. One to keep us within the limit of the given number and the other to store the sum of numbers to be returned.
+* Create a loop to check all numbers lesser than or equal to the given number.
+* Check if a number is prime and add it to the value of sum.
+* Return the value of sum once the loop exits.
+
+
##  Intermediate Code Solution:
function sumPrimes(num) {