clamp MethodStatic

Clamp value to (min, max) with no test for order of (min, max).

  • Always returns a number between min and max.

clamp(value: number, min: number, max: number): number

Parameter Type Description
value number value to clamp
min number smallest allowed output
max number largest allowed output

Returns - number

Defined in

Last Updated: 14 November, 2024