random(): Generating Random Values
random() generates pseudo-random numeric values, commonly in a specified range. It is useful for simulations, sampling, test data, and randomized visual effects.
Randomness and reproducibility
A generated value is not a guarantee of fairness or cryptographic security. For simulation results, record the seed or generated inputs when reproducibility matters. Use randomInt() when outcomes must be integers, and round() only for display rather than to simulate a uniform integer.
Validate lower and upper bounds, especially when bounds may be reversed or equal. Combine random values with min() and max() for clamping only when that distributional effect is intentional.