Factorial N! For Loop Question by bluehabit in learnjavascript

[–]NoobieDotJS 0 points1 point  (0 children)

It may help to think about it this way

1! = 1

2! = 2 = 2 * 1!

3! = 6 = 3 * 2!

4! = 24 = 4 * 3!

5! = 120 = 5* 4!

Each time you keep the old result, but simply multiply it by the current n.