|Top Previous Next|
Most operators, functions, methods, and properties accept operands/arguments of specific types. If the argument is not of the correct type, an automatic conversion is performed according to these rules.
Numeric String Parsing
When parsing a string to a number, a string with the same format as a numeric literal will be accepted. In addition, white space before and after the string is ignored, but embedded white space is not accepted. The number may be preceded by a "+" or "-" sign and leading zeros, unless the number is hex format (starts with "0x" or "0X").
An empty string, or a string containing nothing but white space, is accepted and returns zero.
The strings "Infinity", "+Infinity", and "-Infinity" are accepted. They may include leading and trailing white space.