This means that after rounding down the result will always be 9 or less Generating a random integer between 1 and a max. The Mathrandom function is used to return a floating-point pseudo-random number between range 01 0 inclusive and 1 exclusiveThis random number can then be scaled according to the desired range. Random max -min min.
We can use the random function to get a random number between 0 inclusive and 1 exclusive.
In Javascript Code runs inside out Mathrandom is processed first or evaluated because it is inside the inner parenthesis. Mathfloor Mathrandom 100 1. The result we get is a floating-point number which can include 0 but not 1. The smallest integer greater than or equal to the given number.