Fatorial enquanto o loop reverso em javascript

function myFactorial(number) {
    var fact = 1;
    var i = number;
    while (i >= 1) {
        fact = fact * i;
        i--;
    }
    return fact;
}
console.log(myFactorial(6));
//Output: 720;
Ariful Islam Adil(Code Lover)