Constructor
new Range(lowerBound, upperBound)
Instantiates a Range object.
Parameters:
Name | Type | Description |
---|---|---|
lowerBound |
Number | The minimum number in this range. |
upperBound |
Number | The maximum number in this range. |
Members
lowerBound
Properties:
Name | Type | Description |
---|---|---|
lowerBound |
Number | The minimum number in this range. |
upperBound
Properties:
Name | Type | Description |
---|---|---|
upperBound |
Number | The maximum number in this range. |
Methods
(static) fromArray(values) → {Range}
Creates a Range from an array of two numbers.
Parameters:
Name | Type | Description |
---|---|---|
values |
Array.<Number> | Boundaries of the range. |
Returns:
- Type
- Range
(static) fromNotation(notedRange) → {Range}
Creates a Range from a string-based notation.
Parameters:
Name | Type | Description |
---|---|---|
notedRange |
String | A string representation of a Range, using delimiters. Accepted formats: x,y x;y x:y x~y. |
Returns:
- Type
- Range
includes(value) → {Boolean}
Checks if a value is in the defined range.
Parameters:
Name | Type | Description |
---|---|---|
value |
Number | Value to compare. |
Returns:
true if in range, false otherwise.
- Type
- Boolean
toString() → {String}
Converts the Range object to a string representation.
Returns:
- Type
- String