编写函数,判断一个字符串的内容是不是纯数字

var str = "12345a";
function isNumber(str){
    if( str == 0){
        return true;
    }
    if( str == ""){
        
    }
    return !!Number(str);  
}
 
var res = isNumber(str);
原文地址:https://www.cnblogs.com/tis100204/p/10310117.html