What’s wrong . everything is working except tjhe last one
Your code so far
function sumFibs(num) {
//b3d ama ngeeb el numbers kolha fee array , mommken n3mlha filter lee el odd numbers wa b3deen reduce
let newa = [];
let frst = 1;
let scnd = 1;
let thrd = 0;
while(thrd<num){
newa.push(scnd);
thrd = frst + scnd;
frst = scnd;
scnd = thrd;
}
newa.unshift(1);
return newa.filter(x=> x%2==1?true:false).reduce((a,b)=>a+b)
}
sumFibs(75025);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/sum-all-odd-fibonacci-numbers