First we use Math.random() to create a random number from 0 up to 1. For example, 0.5;

Then we multiply by 5 to make the random number from 0 up to 5. For example, 0.5 * 5 = 2.5;

Next we use Math.floor() to round down to a whole number. For example, Math.floor( 2.5 ) = 2;

I can understand the above three, but the below one:

Finally we add 1 to change the range from between 0 and 4 to between 1 and 5 (up to and including 5);

Isn't it supposed to be:

Finally we add 1 to change the range from between 0 and 5 to between 1 and 6 (up to and including 6) ?