79745238

Date: 2025-08-25 00:03:38
Score: 1
Natty:
Report link

This is the way i make it simple

function factorial(n) {
    res = 1
    for (var i = 1 ; i <= n ; i++) {
        res = res * i
    }
    return res
}

console.log(factorial(5)); // 120
console.log(factorial(0)); // 1
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Ahmed Talbi