410 B
410 B
importance: 2
A random integer from min to max
Create a function randomInteger(min, max)
that generates a random integer number from min
to max
including both min
and max
as possible values.
Any number from the interval min..max
must appear with the same probability.
Examples of its work:
alert( random(1, 5) ); // 1
alert( random(1, 5) ); // 3
alert( random(1, 5) ); // 5