Tell us what’s happening:
i’m off by one in all my tests, and am not sure I understand the logic of the challenge. In order to avoid a spoiler, i’ve deleted my code, but can share if needed.
I could really just use an explanation of how the test sumFibs(4) should produce a result of 5 rather than 4. I may misunderstand Fibonacci numbers, but thought this would be
0+1 = 1. This is an odd number, so current sum is 1
1+1 = 2. This is even, so do nothing with the sum.
1+2 = 3. Current sum is incremented by 3, for a total of 4.
2+3 = 5. This is greater than the input number (4), so stop the function, and don’t change the sum.
Challenge Information:
Build an Odd Fibonacci Sum Calculator - Build an Odd Fibonacci Sum Calculator