Skip to content

Instantly share code, notes, and snippets.

@iamamit-107
Created May 9, 2020 15:53
Show Gist options
  • Save iamamit-107/1d898930cf7902324edcd7f72cb128ef to your computer and use it in GitHub Desktop.
Save iamamit-107/1d898930cf7902324edcd7f72cb128ef to your computer and use it in GitHub Desktop.
function recursiveFactorial(num) {
if (num === 0 || num === 1) {
return 1;
}
return num * recursiveFactorial(num - 1);
}
console.log(recursiveFactorial(6));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment