Private constructorStatic Readonly REGEXPAn immutable RegExp instance, representing a string in Number format.
Static assertVerify the type of number given, throwing if it does not match.
Given a number and a “type”, test to see if the argument is of that type.
Mainly used for parameter validation, when the type number is not specific enough.
The acceptable “types”, which are not mutually exclusive, are members of NumericType.
If no type is given, this method just asserts the number is not NaN.
If the argument matches the described type, this method returns void instead of true.
If the argument does not match, this method throws an error instead of returning false.
This pattern is helpful where an error message is more descriptive than a boolean.
the argument to test
Optional type: NumericTypeone of the enum members listed above
if the argument does not match the described type
if the argument is NaN
Static typethe given number
one of the strings described above
use xjs_Number.assertType Specify the type of number given.
If the number is finite, return one of the following strings:
'integer' : the number is an integer, that is, num % 1 === 0'float' : the number is not an integerElse, throw a RangeError (the argument is of the correct type but does not qualify).
if the given arguemnt was not a finite number
Additional static members for the native Number class.
Does not extend the native Number class.