js判断字符是否为空的方法

//判断字符是否为空的方法
function isEmpty(obj){
    if(typeof obj == "undefined" || obj == null || obj == ""){
        return true;
    }else{
        return false;
    }
}
if (!isEmpty(value)) {
    console.log(value);
}

 

你可能感兴趣的:(js判断字符是否为空的方法)