Function clamp

  • Clamps number within the inclusive lower and upper bounds.

    Parameters

    • number: number

      The number to clamp.

    • lower: number

      The lower bound.

    • upper: number

      The upper bound.

    Returns number

    The clamped number.

    Example

    clamp(42, 30, 40);
    // => 40

Generated using TypeDoc