Created
September 4, 2019 22:59
-
-
Save nicobytes/e86c416f927182829f55bc0a02e29c3a to your computer and use it in GitHub Desktop.
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
const fibonacci = (num: number): number => { | |
if (num === 1 || num === 2) { | |
return 1; | |
} | |
return fibonacci(num - 1) + fibonacci(num - 2); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment