• + 0 comments

    function factorial(n) { let countDown = n; let result = 1;

    while (countDown > 0) { result *= countDown; countDown--; } return result; }