Home > Web Front-end > JS Tutorial > body text

js parseInt('08') does not specify the carry system_javascript skills

WBOY
Release: 2016-05-16 18:25:02
Original
931 people have browsed it

Where string is the string to be converted, and radix is ​​binary, octal, hexadecimal or decimal.
When radix is ​​not specified by default, when it is switched with 0x, it is hexadecimal; if it is switched with 0 and the second digit is not x, it is octal (because octal cannot have 8 or 9, so an error is reported Return 0).
So, we should clearly specify the carry system when we use it to prevent errors.
If we usually use decimal digits, we use parseInt("08", 10);

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template