Tell us what’s happening:
Describe your issue in detail here.

I am not able to figure out what is wrong with the code. Why is not pushing the computed f3 values instead it pushes the index number.

Your code so far

function sumFibs(num) {
let fib = [0, 1,1];
let i = 3
do {
let f1 = fib[i - 1];
let f2 = fib[i - 2];
var f3 = f1+f2;
console.log(fib.push(f3));
i++;
} while (f3 < num)
return fib
.filter(element => element % 2 !== 0)
.reduce((a, b) => a + b);
}
console.log(sumFibs(4));

Your browser information:

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

Challenge: Intermediate Algorithm Scripting - Sum All Odd Fibonacci Numbers