Skip to main content

randomInt

Generates a random integer within a specified range.

Parameters​

ParameterTypeOptionalDefaultDescription
minnumberfalseThe lower bound of the range. This value is inclusive.
maxnumberfalseThe upper bound of the range. This value is exclusive.

Returns​

number

Example​

randomInt(1, 10); // 2