Clamps a number within the given range (min, max).
If the value is less than the min, it returns the min.
If the value is greater than the max, it returns the max.
Otherwise, it returns the value itself.
Parameters
value: number
The number to be clamped.
min: number
The minimum value in the range.
max: number
The maximum value in the range.
Returns number
The clamped value, which is guaranteed to be within the [min, max] range.
Clamps a number within the given range (min, max). If the value is less than the
min, it returns themin. If the value is greater than themax, it returns themax. Otherwise, it returns the value itself.