1.

function isUndefinedOrNull(obj){
    return typeof obj === 'undefined' || obj === null;
}
function isNullOrWhiteSpace(obj){
    return typeof obj === 'undefined' || obj === null || /^\s*$/.test(obj);
}
function isBoolean(obj){
    return obj === true || obj === false;
}
function isInt(obj){
    return Number(obj) === obj && obj % 1 === 0;
}
function isFloat(obj){
    return obj === Number(obj) && obj % 1 !== 0;
}
function isNumber(obj){
    return obj === Number(obj);
}
function padLeft(obj){
    return (Array(length).join('0') + n).substr(-length);
}
function objectLength(obj){
    var size = 0, key;
    for (key in obj) {
        if (obj.hasOwnProperty(key)) size++;
    }
    return size;
}
function IsNullOrEmpty(obj){
    obj === null || obj==="";
}

 

posted on 2020-03-24 18:14  JioNote  阅读(129)  评论(0编辑  收藏  举报