randomInt

randomInt

Generate a random integer number between two values. (borders are included)

Import

import { randomInt } from '@fullstacksjs/toolbox';

Signature

function randomInt(min: number = 0, max: number = Number.MAX_SAFE_INTEGER): number {}

Examples

randomInt()      // Random between 0,  MAX_SAFE_INTEGER
randomInt(10)    // Random between 10, MAX_SAFE_INTEGER
randomInt(0, 1)  // 0 | 1