Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Factorial multiplication in javascript

function factorial(n) {
    if (n == 1) {
        return 1;
    }
    return n * factorial(n - 1);
}
console.log(factorial(6));
//Output: 720
 
PREVIOUS NEXT
Tagged: #Factorial #multiplication #javascript
ADD COMMENT
Topic
Name
3+4 =