Constructor
new Comparator(callback)
- Source:
- Since:
- 1.3.0
create new comparator
Parameters:
Name | Type | Description |
---|---|---|
callback |
function |
Methods
equal(a, b) → {boolean}
- Source:
Checks if two variables are equal.
Parameters:
Name | Type | Description |
---|---|---|
a |
* | |
b |
* |
Returns:
- Type
- boolean
greaterThan(a, b) → {boolean}
- Source:
Checks if variable a
is greater than b
Parameters:
Name | Type | Description |
---|---|---|
a |
* | |
b |
* |
Returns:
- Type
- boolean
greaterThanOrEqual(a, b) → {boolean}
- Source:
Checks if variable a
is greater than or equal to b
Parameters:
Name | Type | Description |
---|---|---|
a |
* | |
b |
* |
Returns:
- Type
- boolean
lessThan(a, b) → {boolean}
- Source:
Checks if variable a is less than b
Parameters:
Name | Type | Description |
---|---|---|
a |
* | |
b |
* |
Returns:
- Type
- boolean
lessThanOrEqual(a, b) → {boolean}
- Source:
Checks if variable a
is less than or equal to b
Parameters:
Name | Type | Description |
---|---|---|
a |
* | |
b |
* |
Returns:
- Type
- boolean
reverse() → {Comparator}
- Source:
changes the order of the operators
Returns:
- Type
- Comparator