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)

 return sieve.reduce((acc,el)=>{
   return acc+el;
function isPrime(n){
    return false;
  }else if(n===2){
    return true;
    for(let i=2;i<n;i++){
        return false;
    return true;

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:

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