Sum All Odd Fibonacci Numbers,a test can't pass

Sum All Odd Fibonacci Numbers,a test can't pass
0

#1

Tell us what’s happening:
sumFibs(75024) should return 60696.

Your code so far


function sumFibs(num) {
  let f1 = 1;
  let f2 = 1;
  let f3 = 0;
  let arr = [1];
  let sum = 0;
  for (;sum < num;)
  {
    f3 = f1+f2;//2,  3=1+2,5=2+3,8=5+3,13=5+8
    f1 = f2;//   1,  2,    3,    5,    8,
    f2 = f3;//   2,  3,    5,    8,    13,
    if(f1%2 !== 0) 
    {
      arr.push(f1);
      sum = 0;
      for (let i = 0; i < arr.length; i++)
      {
        sum+=arr[i];
      }
    }          
  }
  return sum;
} 
console.log(sumFibs(75025));

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36 OPR/55.0.2994.61.

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