ts-data-forge
    Preparing search index...

    Function isInRange

    • Creates a function that checks if a number x is within the range lowerBound <= x < upperBound.

      Parameters

      • lowerBound: number

        The lower bound (inclusive).

      • upperBound: number

        The upper bound (exclusive).

      Returns (x: number) => boolean

      A function that takes a number x and returns true if x is in the range, false otherwise.

      const isGrade = Num.isInRange(0, 100);

      assert.ok(isGrade(50));
      assert.notOk(isGrade(100));