Class: Range

Range

Represents a range of number, described through boundaries.

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.
Source:

Members

lowerBound

Properties:
Name Type Description
lowerBound Number The minimum number in this range.
Source:

upperBound

Properties:
Name Type Description
upperBound Number The maximum number in this range.
Source:

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.
Source:
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.
Source:
Returns:
Type
Range

includes(value) → {Boolean}

Checks if a value is in the defined range.
Parameters:
Name Type Description
value Number Value to compare.
Source:
Returns:
true if in range, false otherwise.
Type
Boolean

toString() → {String}

Converts the Range object to a string representation.
Source:
Returns:
Type
String