Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Factorial Recursion Function in Javascript

function factorialRecursion(n) {
    if (n == 1) {
        return 1;
    }
    return n * factorialRecursion(n - 1);
}
console.log(factorialRecursion(5))
//Output: 120
 
PREVIOUS NEXT
Tagged: #Factorial #Recursion #Function #Javascript
ADD COMMENT
Topic
Name
5+8 =