has()
Checks whether the value is in the range of a specified `Range` object
Range.prototype.has()
Range.prototype.has()The has() method checks whether the value is in the range of a specified Range object.
public has(value: number): boolean {
return (
(this.minLessThan(value) && this.maxGreaterThan(value)) ||
value === this.min ||
value === this.max
);
}Parameters
The value of number type to test.
Return type
Returns
The return value is a boolean indicating whether the given value is in the range of a specified Range object.
Example usage
Last updated