Skip to content

Instantly share code, notes, and snippets.

@BolajiOlajide
Created February 25, 2018 19:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BolajiOlajide/2e360db2294be46920dc32fdec272e48 to your computer and use it in GitHub Desktop.
Save BolajiOlajide/2e360db2294be46920dc32fdec272e48 to your computer and use it in GitHub Desktop.
Example of a recursive function
function factorial(number) {
if (number === 1) {
return 1;
}
return number * factorial(number - 1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment