Flocc
    Preparing search index...

    Function clamp

    • Given a number and min and max values, restrict the number to the range specified.

      clamp(5, 1, 10); // returns 5
      clamp(5, 2, 4); // returns 4
      clamp(0, -4, -3); // returns -3

      Parameters

      • x: number
      • min: number
      • max: number

      Returns number

      0.0.5