Update fibonacci-solution.js

This commit is contained in:
Nathan
2023-07-06 09:47:20 -05:00
committed by GitHub
parent fcb1c4971a
commit 51572a070c
+2 -4
View File
@@ -4,13 +4,11 @@ const fibonacci = function(count) {
let firstPrev = 1;
let secondPrev = 0;
// For clarification: curr stands for current. This is standard syntax
for (let i = 2; i <= count; i++) {
let curr = firstPrev + secondPrev;
let current = firstPrev + secondPrev;
secondPrev = firstPrev;
firstPrev = curr;
firstPrev = current;
}
return firstPrev;