Functions
Browse all available utility functions by category
number
clamp
Clamps a number between a lower and upper bound.
Example:
clamp(-10, -5, 5); // -5number
inRange
Checks if a number is between start and up to, but not including, end. If end is not specified, it's set to start with start then 0.
Example:
inRange(3, 2, 4); // truenumber
random
Produces a random number between the inclusive lower and upper bounds. If only one argument is provided, a number between 0 and the given number is returned. If floating is true, or either lower or upper are floats, a floating-point number is returned instead of an integer.
Example:
random(0, 5); // an integer between 0 and 5