Skip to content

Instantly share code, notes, and snippets.

@subhodi
Created March 2, 2018 10:50
Show Gist options
  • Save subhodi/0488cf499f378b3d5db390ed64f5bb2f to your computer and use it in GitHub Desktop.
Save subhodi/0488cf499f378b3d5db390ed64f5bb2f to your computer and use it in GitHub Desktop.
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