Constrains number between min and max values

  • Parameters

    • bounds: [number, number]

      Minimum and maximum allowed values

    • n: number

      Number to clamp

    Returns number

    Clamped value