By multiplying the random number (which is between 0 and 1) by 5, we make it a random number between 0 and 5 (for example, 3.1841). Math.floor() rounds this number down to a
Note that:
0 <= Math.random() **<** 1
Math.floor(x.yz) = x
And therefore, the number given is a integer in the interval:
x = Math.floor((0..0.999999999) * 5 + 1) x = (0..4) + 1