You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
function value_limit(val, min, max) {
|
|
return val < min ? min : (val > max ? max : val);
|
|
}
|
|
|
|
console.log(value_limit(7, 1, 12));
|
|
console.log(value_limit(-7, 0, 12));
|
|
console.log(value_limit(15, 0, 12));
|