Module

x/lodash_es/mod.ts>clamp

lodash for deno use
Latest
function clamp
import { clamp } from "https://dotland.deno.dev/x/lodash_es@v0.0.2/mod.ts";

Clamps number within the inclusive lower and upper bounds.

Examples

_.clamp(-10, -5, 5); // => -5

_.clamp(10, -5, 5); // => 5

Parameters

number

The number to clamp.

lower

The upper bound.

upper