Creates a function that checks if a number x is within the range lowerBound <= x <= upperBound.
x
lowerBound <= x <= upperBound
The lower bound (inclusive).
The upper bound (inclusive).
A function that takes a number x and returns true if x is in the range, false otherwise.
true
false
const isPercentage = Num.isInRangeInclusive(0, 100);assert.ok(isPercentage(100));assert.notOk(isPercentage(-1)); Copy
const isPercentage = Num.isInRangeInclusive(0, 100);assert.ok(isPercentage(100));assert.notOk(isPercentage(-1));
Creates a function that checks if a number
x
is within the rangelowerBound <= x <= upperBound
.