function rand
rand(
start: number,
end: number,
): number

Gives a random number in the given range. The first parameter is inclusive and the second one is exclusive. Therefore, it will work with lists out of the box.

Examples

Example 1

rand(0, 10); // 0 -> 9
rand(3, 7); // 3 -> 6

Parameters

start: number
end: number

Return Type

number

Usage

import { rand } from ".";