UNPKG

diginext-utils

Version:
20 lines 600 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.randomInt = randomInt; /** * Generates a random integer between min and max (inclusive). * * @param min - The minimum value (inclusive) * @param max - The maximum value (inclusive) * @returns A random integer between min and max * * @example * ```ts * randomInt(1, 10); // Random integer between 1 and 10 * randomInt(0, 100); // Random integer between 0 and 100 * ``` */ function randomInt(min, max) { return min + Math.floor(Math.random() * (max - min + 1)); } //# sourceMappingURL=randomInt.js.map