@qntm-code/utils
Version:
A collection of useful utility functions with associated TypeScript types. All functions have been unit tested.
14 lines (13 loc) • 432 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.randomNumberBetweenRange = void 0;
/**
* Returns a random whole number between a given range
*/
function randomNumberBetweenRange(min, max) {
min = Math.ceil(min);
max = Math.floor(max);
const value = Math.random() * (max - min + 1) + min;
return Math.floor(value);
}
exports.randomNumberBetweenRange = randomNumberBetweenRange;