If parseInt encounters a character that is not a numeral in the specified radix, it ignores it and all succeeding characters and returns the integer value parsed up to that point. Leading and trailing spaces are allowed.
To convert number to its string literal in a particular radix use intValue. The following may have an octal result, or it may have a decimal result. Always specify a radix to avoid this unreliable behavior.
The ECMAScript 5 specification of the function parseInt no longer allows implementations to treat Strings beginning with a 0 character as octal values. The parseInt function produces an integer value dictated by interpretation of the contents of the string argument according to the specified radix. Leading white space in string is ignored.
If radix is undefined or 0it is assumed to be 10 except when the number begins with the character pairs 0x or 0Xin which case a radix of 16 is assumed. Many implementations have not adopted this behavior as ofand because older browsers must be supported, always specify a radix. Get the latest and greatest from MDN delivered straight to your inbox. Please check your inbox or your spam filter for an email from us.
IP addresses are not linked to personally identifiable information. This information is not shared with third parties and is used only within this Company on a need-to-know basis.
Any individually identifiable information related to this data will never be used in any way different to that stated above without your explicit permission.