Utils.clamp()

Clamp the number givens as first parameter into the limits of the min and max numbers given as second ans third parameters

Parameters

NameTypeDescription
1xnumber
2minnumber
3maxnumber

Return value

number

the result

Usage

import {Utils} from '@lcluber/type6js';

let clamp = Utils.clamp(2,4,10);
console.log(clamp); //4