Skip to content

Instantly share code, notes, and snippets.

@rlucha
Created March 23, 2016 02:03
Show Gist options
  • Save rlucha/220e5f66c88a7423db39 to your computer and use it in GitHub Desktop.
Save rlucha/220e5f66c88a7423db39 to your computer and use it in GitHub Desktop.
function* fib(a, b) {
let c = 0
yield a
yield b
while (true) {
c = a + b
a = b
b = c
yield c
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment