num = 5 factorialn = 1 function factorial() { for (i = 1; i <= num; i++) { factorialn *= i } } factorial() console.log(factorialn)