constrain(x, min, max);
Limits x to a minimum and maximum value.
Arguments
x
The input valuemin
The minimum valuemax
The maximum valueReturns
number
The constrained valueconstrain(x, min, max);
Limits x to a minimum and maximum value.
x
The input valuemin
The minimum valuemax
The maximum valuenumber
The constrained value