Skip to content

Instantly share code, notes, and snippets.

@dmlap
Created June 25, 2017 22:45
Show Gist options
  • Save dmlap/c8e489ea6d5c860a6d304125f2d7e21d to your computer and use it in GitHub Desktop.
Save dmlap/c8e489ea6d5c860a6d304125f2d7e21d to your computer and use it in GitHub Desktop.
Recursively generate the Fibonacci sequence. (This loops forever since javascript is eagerly evaluated)
function fibonnaci(n0, n1) {
let n2 = n0 + n1
console.log(n2)
return fibonnaci(n1, n2)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment