NewDash

    Function clamp

    • Clamps number within the inclusive lower and upper bounds.

      Parameters

      • num: number

        The number to clamp.

      • Optionallower: number

        The lower bound.

      • Optionalupper: number

        The upper bound.

      Returns number

      Returns the clamped number.

      5.7.0

      clamp(-10, -5, 5)
      // => -5

      clamp(10, -5, 5)
      // => 5
    MMNEPVFCICPMFPCPTTAAATR