The number to clamp.
The upper bound.
Returns the clamped number.
Checks if n is between start and up to but not including, end. If end is not specified it’s set to start with start then set to 0.
The number to check.
The start of the range.
The end of the range.
Returns true if n is in the range, else false.
Produces a random number between min and max (inclusive). If only one argument is provided a number between 0 and the given number is returned. If floating is true, or either min or max are floats, a floating-point number is returned instead of an integer.
Specify returning a floating-point number.
Returns the random number.
Produces a random number between min and max (inclusive). If only one argument is provided a number between 0 and the given number is returned. If floating is true, or either min or max are floats, a floating-point number is returned instead of an integer.
The minimum possible value.
Not used in this overload.
Enables use as an iteratee for methods like _.map. You should not pass this parameter directly in your code.
Returns the random number.
Generated using TypeDoc
Clamps
number
within the inclusivelower
andupper
bounds.Number
_.clamp(-10, -5, 5); // => -5
_.clamp(10, -5, 5); // => 5