a library to speed up the development of Fivem scripts and frameworks
fivem-ts - Documentation v0.7.5 • Docs
fivem-ts - Documentation v0.7.5 / Shared / clamp
clamp(
num
,min
,max
):number
Clamps a number to a specified range.
• num: number
The number to clamp.
• min: number
The minimum value.
• max: number
The maximum value.
number
The clamped value.
clamp(5, 1, 10); // 5
clamp(0, 1, 10); // 1
clamp(15, 1, 10); // 10