Fibancii challange...can someone please explain why this is happening?

its in a spoiler tag because I think its a solution, albeit a bad one.just getting the idea to work first then improving it. I’m not sure if this is a glitch or something I’m not seeing or understanding.

here is the code if you need it.

var fibArr=[0,1];
function sumFibs(num) {
  var newNum=0;
  var total=0;
    var i=fibArr.length-1;
    var lastNum=fibArr[i];
    var oldNum=fibArr[i-1];
  for(var j=0;j<fibArr.length-1;j++){
    if(fibArr[j]%2!=0&& total<num){total+=fibArr[j];
  return total;


total<=num i guess!