Created
March 2, 2018 10:50
-
-
Save subhodi/0488cf499f378b3d5db390ed64f5bb2f to your computer and use it in GitHub Desktop.
Fibonacci series
This file contains 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
fiboncacci = (n, fibb=[]) => { | |
count=0; | |
fib = (i, j) => { | |
if (count == n) return fibb; | |
fibb.push(i); | |
count++; | |
return fib(i + j, i); | |
} | |
return fib(0, 1); | |
} | |
console.log(fiboncacci(10)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment