js 判断是否为空

var isEmpty = function (value) {
return (
value === undefined ||
value === null ||
(typeof(value) === "object" && value.length === 0) || //如果使用Object.keys(value).length 对时间对象无效 ????
(typeof(value) === "string" && value.trim().length === 0)
)
}

posted @ 2019-03-08 15:16  不得湖,涯也  阅读(215)  评论(0编辑  收藏  举报