Generates a random integer between the specified minimum and maximum values (inclusive).
The minimum integer value (inclusive).
The maximum integer value (inclusive).
A random integer between min and max.
Will throw an error if the minimum value is greater than the maximum value.
Will throw a TypeError if either min or max is not a finite number.
randomInt(1, 10) // could return any integer from 1 to 10randomInt(5, 5) // will always return 5randomInt(10, 1) // throws an error Copy
randomInt(1, 10) // could return any integer from 1 to 10randomInt(5, 5) // will always return 5randomInt(10, 1) // throws an error
Generates a random integer between the specified minimum and maximum values (inclusive).