Clamp a number between min and max
返回一个介于最小值和最大值之间的数字
The number to clamp. 要限制的数字
The minimum value. 最小值
The maximum value. 最大值
The clamped number. 限制后的数字
clamp(5, 0, 10) // => 5clamp(10, 0, 5) // => 5 Copy
clamp(5, 0, 10) // => 5clamp(10, 0, 5) // => 5
Clamp a number between min and max
返回一个介于最小值和最大值之间的数字