Skip to content

Instantly share code, notes, and snippets.

@nicobytes
Created September 4, 2019 22:59
Show Gist options
  • Save nicobytes/e86c416f927182829f55bc0a02e29c3a to your computer and use it in GitHub Desktop.
Save nicobytes/e86c416f927182829f55bc0a02e29c3a to your computer and use it in GitHub Desktop.
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