//判断对象是否为空
//console.log(isEmptyObject()); //true
//console.log(isEmptyObject({})); //true
//console.log(isEmptyObject(null)); //true
//console.log(isEmptyObject(23)); //true
//console.log(isEmptyObject({"te": 2})); //false
function isEmptyObject(e) {
var t;
for (t in e){
return !1;
}
return !0
}
//判断字符串是否为空
function isEmptyStr(str){
if(str == null || str == ‘null‘ || str == undefined || str == ‘undefined‘ || str.match(/^[\s]*$/)){
return true;
}else{
return false;
}
}
时间: 2024-11-05 16:02:03