Number.parseInvariant Function
Returns a numeric value from a string representation of a number. This function is static and can be called without creating an instance of the object.
var numberVar = Number.parseInvariant(value);
A floating-point representation of value, if value represents a number; otherwise, NaN (not a number).
Use the parseInvariant function to create a numeric value from a string representation of a number. The value argument can contain a decimal point and the "+" and "-" characters to indicate positive and negative, respectively.
The parseInvariant function provides consistent parsing across all types and should be used instead of the similar ECMAScript (JavaScript) parseInt method.
Show: