This article is a mirror article of machine translation, please click here to jump to the original article.

View: 10259|Reply: 0

[TypeScript] TS Missing radix parameter (radix)

[Copy link]
Posted on 6/9/2020 11:36:06 AM | | | |
parseInt(String s, int radix) is to find the decimal number of "String s".

We usually use Number.parseInt("123");

In fact, the default is to call Number.parseInt("123",10);  

The default of 10 represents is decimal, and the conversion process can be seen as:  
                          
1*10*10+2*10+3  
If so

Number.parseInt("123",16);

It can be seen as:  

1*16*16+2*16+3 = 291






Previous:Role-based Authorization
Next:Angular 9 series (VI) calls native JS variables and methods
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com