Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Fibonacci series
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