Need help with Sum odd Primes numbers

Tell us what’s happening:
I have tried to get the sum of odd prime numbers bu iam getting a wrong answer for 977,what am i doing wrong?

Your code so far


function sumPrimes(num) {
  let sieve =[2];

 for(let i=0;i<=num;i++){
   if(isPrime(i)===true && i%2!==0)
   {
sieve.push(i);
   }
   }


 return sieve.reduce((acc,el)=>{
   return acc+el;
 })
}
function isPrime(n){
  if(n===1){
    return false;
  }else if(n===2){
    return true;
  }else{
    for(let i=2;i<n;i++){
      if(n%i===0){
        return false;
      }
    }
    return true;
  }
}
console.log(sumPrimes(900));

Your browser information:

User Agent is: Mozilla/5.0 (Linux; Android 7.0; TECNO W1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.80 Mobile Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/sum-all-primes/

Your code seems to be returning the right value. What error message are you getting?

I meant the calculations, not whether the code was actually returning your result.

I get wrong answer for 977 but for 10 its working ok