I need to complete theses task, so I have made a function to sum Fibonacci series. But I need to sum until I get the number which is asked for by the program. Can you make any suggestions? Please, correct my english if it is necessary and help me to get the answer for my code.
sumFibs(1000) should return 1785. sumFibs(4000000) should return 4613732. sumFibs(75024) should return 60696. sumFibs(75025) should return 135721.
function sumFibs(num) {
let numArr=[];
for(let i=0;i<=num;i++){
numArr.push(i)
}
console.log()
let oddNumArr=numArr.filter(numbers=>numbers % 2 !== 0)
oddNumArr.unshift(1)
let reducedArr=oddNumArr.reduce((a, b) => a + b, 0)
return reducedArr;
console.log(reducedArr)