var str='1250' ;
alert( Number(str) ); //Get 1250
alert(parseInt(str)); //Get 1250
var str1='00100';
alert( Number (str1) ); //Get 100
alert(parseInt(str1)); //Get 64
It is found that the parseInt method will be used as a number starting with format'00' Convert binary to decimal, so it is recommended to use the Number method to convert string to int.