Skip to content

Instantly share code, notes, and snippets.

@bignimbus
Last active September 16, 2016 19:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bignimbus/45726f517b21ff64547bb418d54a7222 to your computer and use it in GitHub Desktop.
Save bignimbus/45726f517b21ff64547bb418d54a7222 to your computer and use it in GitHub Desktop.
Recursive sequential generator of Fibonacci numbers
function * fibonacci (one = 1, two = 1) {
let sum = one + two;
yield sum;
yield * fibonacci(two, sum);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment