javascript-exercises icon indicating copy to clipboard operation
javascript-exercises copied to clipboard

Fibonacci solution bug

Open dragi-ns opened this issue 4 years ago • 1 comments

Current fibonacci solution returns 1 instead of 0 when passed "0", because it uses strict equality.

https://github.com/TheOdinProject/javascript-exercises/blob/8150be944bc01cb3bea5b50a760ae88e405693c1/fibonacci/fibonacci.js#L3

I'm opening this issue because tests state that the function should accept a string representation of a number.

dragi-ns avatar Nov 04 '21 20:11 dragi-ns

Wouldn't a simple count = parseInt(count, 10); work here?

yasledesma avatar Nov 28 '21 01:11 yasledesma

I fixed this issue!

Nitinbhojsingh avatar May 11 '23 15:05 Nitinbhojsingh

No the issue is not fixed. I still find the solution for fibonacci exercise has count === 0. I just forked the repo a week ago.

draczihper avatar Oct 06 '23 21:10 draczihper

@KelvinMvungi would you mind opening a new issue to explain what the issue is you’re having? That would make things easier to investigate and assign since the issues you’re commenting on are closed or very old it seems. You can reference these issue numbers or link to them in a new issue with your explanation and code example on how to reproduce the error you’re encountering

ManonLef avatar Oct 06 '23 21:10 ManonLef

@ManonLef I found the same exact issue which was solved a couple of weeks ago and the PR was merged but it did not appear in the repo. The repo had the same old problem but it's not a big deal, it's a simple issue.

draczihper avatar Oct 08 '23 20:10 draczihper