static isGreater()
Checks whether the given value is the Greater instance of any or given primitive value
Greater.isGreater()
Checks whether the given value is the Greater instance of any or given primitive value.
public static isGreater<Value extends number>(
value: any,
greaterValue?: Value
): value is Greater<Value> {
return (
typeof value === 'object' &&
value instanceof this &&
(typeof greaterValue === 'number'
? value.valueOf() === greaterValue
: true)
);
}Generic type variables
Valueextendsnumber
A generic type variable indicates captured type of the supplied greaterValue via the return type.
Parameters
value:any
The value of any type to test against the Greater instance.
greaterValue:Value
An optional value of generic type variable Value to check whether it's the primitive value of the given value.
Return type
Greater<Value>
The return type is a boolean resulting from its statement indicating the value is the Greater object that takes the generic type variable Value.
Returns
The return value is a boolean indicating whether the given value is the Greater instance of any or given primitive value.
Example usage
Last updated