Home >Web Front-end >JS Tutorial >JavaScript's parseInt base problem_javascript skills

JavaScript's parseInt base problem_javascript skills

WBOY
WBOYOriginal
2016-05-16 18:53:15950browse

After looking through the JS programming manual, it turns out that parseInt will automatically convert the passed parameter value into the corresponding eight, ten, and hexadecimal value. In this case, the base can be set to distinguish special situations.

Copy code The code is as follows:

parseInt(09,2) | parseInt( 09,10) | parseInt(09,8) | parseInt(09,16)

In fact, problems like these can be completely avoided. The key is to be patient.
Statement:
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