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