???????????alert(parseInt(‘456lee‘)); ??//456,返回正数部分 ???????????alert(parseInt(‘lee456lee‘)); ??//NaN ???????????alert(parseInt(‘lee456lee‘)); ??//NaN ???????????alert(parseInt(‘‘)); ??????? //NaN
Js parsetInt() 字符串转换,只能转换字符串,数字开头的才会返回数值,否则为NaN,空字符串也返回NaN
原文地址:https://www.cnblogs.com/xiaoxinzi/p/8480356.html