I think I found a bug!

function sumFibs(num) {
  var arr = [1, 1];
  
  for (var i =0; i < num - 2; i++) {
    arr.push(arr[i] + arr[i + 1]);
  }
  
  return arr;
}

sumFibs(4);

I don’t know if something is broken on fcc or something is wrong with my pc but I have tried this code in multiple web browsers and every time I try to run it the window freezes.

You are not supposed to be returning an array. You are supposed to be returning a single number which is the sum of all odd Fibonacci numbers that are less than or equal to num. Since your code returns an array, the FCC tests attempt to display the result (an array) and when the test gets to sumFibs(4000000) it is too much for the browser. Make sure you are returning a number instead of an array.

1 Like

Ohh! right I got it! I now understand how the challenges work. I completed the challenges tho… Thanks!