Skip to content

Instantly share code, notes, and snippets.

@methodin
Created December 28, 2011 16:49
Show Gist options
  • Save methodin/1528635 to your computer and use it in GitHub Desktop.
Save methodin/1528635 to your computer and use it in GitHub Desktop.
Fibonacci Sequence
function fib(n) {
return n<2 ? n : fib(n-1)+fib(n-2);
}
var n = 16;
var result = fib(n);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment