var factorial = 1; function myfact(fact) { for (let i = 1; i <= 5; i++) { factorial = factorial * i; } return factorial; } console.log(myfact(factorial)) // Output: 120