Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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