Number.clampMin
clampMin($min) -> number
Description
Make sure the number is not lower than $min
.
If it is lower than $min
, returns $min
. Otherwise, it returns the number.
$num = -5 $num.clampMin(1) //= 1 $num = 3 $num.clampMin(1) //= 3 $num = -17 $num.clampMin(-10) //= -10