js判断对象是否为空

 

//判断是否为空,为空返回true
function strIsNullOrEmpty(str0) {
    var str = String(str0);
    var res = false;
    if (str == '' || str == null || str == undefined || str == 'undefined')
        res = true;
    return res;
}

 

posted @ 2019-08-22 10:58  Vaynedy  阅读(398)  评论(0编辑  收藏  举报