Last active
October 25, 2019 09:23
-
-
Save hadaytullah/18ad18ced976b986584bb05d77fd32ee to your computer and use it in GitHub Desktop.
Fibonacci series generator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fibo=function(n){ | |
var resp=[],previous=0, current=1; | |
while(current<n){ | |
var currentCopy=current; | |
console.log(current); | |
current= previous + current; | |
previous=currentCopy; | |
} | |
} | |
fibo(10); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment