Skip to content

Instantly share code, notes, and snippets.

@rinchik
Last active January 28, 2017 18:14
Show Gist options
  • Save rinchik/dc5e5735a2e70957198f2614a37a2cb7 to your computer and use it in GitHub Desktop.
Save rinchik/dc5e5735a2e70957198f2614a37a2cb7 to your computer and use it in GitHub Desktop.
FibonacciRecursion.js
function fibonacci(number) {
if (number < 1)
return 0;
if (number <= 2)
return 1;
return fibonacci(number - 1) + fibonacci(number - 2);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment