UNPKG

softkave-js-utils

Version:

JavaScript & Typescript utility functions, types, and classes

13 lines 458 B
/** Generates a random number between `min` and `max`. `min` is inclusive and * `max` is exclusive */ export function getRandomInt( /** `min` is inclusive and `max` is exclusive */ min, /** `max` is exclusive and `min` is inclusive */ max) { min = Math.ceil(min); max = Math.floor(max); // The maximum is exclusive and the minimum is inclusive return Math.floor(Math.random() * (max - min) + min); } //# sourceMappingURL=getRandomInt.js.map