# Module: random

Returns a random integer between a minimum and a maximum.

import { random } from 'utilist';

random(1, 10); // returns a random integer between 1 and 9

remarks This method does not provide cryptographically secure random numbers. Do not use them for anything related to security.

# Functions

# random

random(min: number, max: number, isMaxInclusive: boolean): number

Defined in src/random.ts:22

Parameters:

Name Type Default Description
min number - The lower number of the range (always inclusive).
max number min The higher number of the range. Defaults to min.
isMaxInclusive boolean false Whether the higher number of the range should be inclusive or exclusive. Defaults to false.

Returns: number