docs
evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
Build a utility that generates random values within specified ranges and selects random items from collections.
getRandomInt(1, 10) returns an integer between 1 and 10 inclusive @testgetRandomInt(5, 5) always returns 5 @testgetRandomInt(10, 1) correctly handles reversed bounds and returns an integer between 1 and 10 @testgetRandomFloat(0, 1) returns a float between 0 and 1 inclusive @testgetRandomFloat(5.5, 10.5) returns a float between 5.5 and 10.5 @testpickRandomItem(['apple', 'banana', 'cherry']) returns one of the three items @testpickRandomItem([42]) returns 42 @test/**
* Generates a random integer between min and max (inclusive).
* If only one argument is provided, returns a random integer between 0 and that number.
* Handles reversed bounds automatically.
*
* @param {number} min - The lower bound (or upper bound if max is not provided)
* @param {number} max - The upper bound (optional)
* @returns {number} A random integer in the specified range
*/
function getRandomInt(min, max);
/**
* Generates a random floating point number between min and max (inclusive).
*
* @param {number} min - The lower bound
* @param {number} max - The upper bound
* @returns {number} A random float in the specified range
*/
function getRandomFloat(min, max);
/**
* Selects a random item from the provided array.
*
* @param {Array} items - The array to select from
* @returns {*} A randomly selected item from the array
*/
function pickRandomItem(items);
module.exports = {
getRandomInt,
getRandomFloat,
pickRandomItem
};Provides utility functions for working with numbers and arrays.