Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Factorial Function Javascript

var factorial = 1;
function myfact(fact) {
    for (let i = 1; i <= 5; i++) {
        factorial = factorial * i;
    }
    return factorial;
}
console.log(myfact(factorial))
 // Output: 120
Source by 1loc.dev #
 
PREVIOUS NEXT
Tagged: #Factorial #Function #Javascript
ADD COMMENT
Topic
Name
3+8 =