• + 1 comment

    See a lot of solutions using logic, isn't the simplest (in JS)

    function factorial(n) {
        // Write your code here
        var f = 1
        for (let i = 1; i <= n; i++){
            f *= i 
        }
        return f
    }