Last active
January 28, 2017 18:14
-
-
Save rinchik/dc5e5735a2e70957198f2614a37a2cb7 to your computer and use it in GitHub Desktop.
FibonacciRecursion.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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