Open BnayaZil opened 4 years ago
https://github.com/trekhleb/javascript-algorithms/blob/dc1047df725117c411959692a1ab538f65342b2e/src/algorithms/math/fibonacci/fibonacci.js#L13
This condition is redundant, the while condition covers the case where n equals 1.
n
1
p.s- I will exploit this opportunity to say thank you for this repository.
Actually, if u want to be bolt prof u better check n for being greater than or equal to 1.
I created a PR that removes that condition: https://github.com/trekhleb/javascript-algorithms/pull/400
https://github.com/trekhleb/javascript-algorithms/blob/dc1047df725117c411959692a1ab538f65342b2e/src/algorithms/math/fibonacci/fibonacci.js#L13
This condition is redundant, the while condition covers the case where
n
equals1
.p.s- I will exploit this opportunity to say thank you for this repository.