function random
random(
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

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

Parameters

start: number
end: number

Return Type

number

Usage

import { random } from ".";