-
Notifications
You must be signed in to change notification settings - Fork 0
Mint.utils.getRandomInt
Tania Shatilova edited this page Nov 10, 2015
·
1 revision
The getRandomInt() method returns a random number within a specified range.
var random = Mint.utils.getRandomInt([min[, max]]);- min - (int, optional) The inclusive lower bound of the random number returned. Default value is 0.
- max - (int, optional) The exclusive upper bound of the random number returned. Max must be greater than or equal to min. Default value is Number.MAX_VALUE.
A signed integer greater than or equal to min and less or equal than max; that is, the range of return values includes min and max. If min equals max, min is returned.
Mint.utils.getRandomInt(1, 8); // 6
Mint.utils.getRandomInt(1); // 1.794066025907234e+308
Mint.utils.getRandomInt(); // 1.0024528559121937e+308
Mint.utils.getRandomInt("12"); // Error