JavaScript, jQuery: How to convert a string type number to an integer type

Reference: https://jingyan.baidu.com/article/fcb5aff7f91f9fadab4a7172.html

In JavaScript or jQuery, you can multiply the obtained string number by 1 to convert it to an integer type . In other words, if you want to automatically convert a number of string type to an integer type, just multiply it by 1.

Sample code:

 

 

 

 

Guess you like

Origin blog.csdn.net/banzhengyu/article/details/130704951