Namespace RNG

Represents a composable random number generator.

RNG

Memberof

InternalUtils

Example

// Generate a random integer between 1 and 100 (inclusive)
const randomInteger = RNG.integer(1, 100);
console.log(randomInteger); // Output: e.g., 42

// Generate a random floating-point number between 0 and 1 (inclusive)
const randomFloat = RNG.float(0, 1);
console.log(randomFloat); // Output: e.g., 0.12345

// Pick a random element from an array
const colors = ['red', 'blue', 'green', 'yellow'];
const randomColor = RNG.element(colors);
console.log(randomColor); // Output: e.g., "blue"

Index

Variables

Functions

Generated using TypeDoc