Update fibonacci.js
This commit is contained in:
parent
abcaeb918a
commit
3b51e5dbef
1 changed files with 1 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
||||||
const fibonacci = function(count) {
|
const fibonacci = function(count) {
|
||||||
if (count < 0) return "OOPS";
|
if (count < 0) return "OOPS";
|
||||||
|
if (count == 0) return 0;
|
||||||
let a = 0;
|
let a = 0;
|
||||||
let b = 1;
|
let b = 1;
|
||||||
for (let i = 1; i < count; i++) {
|
for (let i = 1; i < count; i++) {
|
||||||
|
|
Loading…
Reference in a new issue