Stuck on the Fibenacci challenge

function sumFibs(num) {

let arr = [1,1];

while (num > 0){

let fibNum = arr[arr.length-1] +arr[arr.length-2];

if (fibNum <= num ){

  num --;

let oddSeq = arr.filter( val => 
return val%2 !== 0;


let result = oddSeq.reduce((item, val) => {

return item+val;


return result;



My code so far

I can’t seem to get why the last test won’t pass.

Take a look at this: your fibNum loop decreases the value of the num parameter, so you’re not catching the last fibonacci number (75025 is a fibonacci number)

1 Like

Bless you! I just needed to make a counter. Thank you so much!


Very glad I could help! Make sure you take a moment to celebrate your success!

1 Like