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)
)
}

遇到挫败,要学会左手温暖右手,相信明天会更好,after all,tomorrow is another day,满怀希望的活下去,不放弃学习,不放弃努力,forever youthful,forever weeping!!
原文地址:https://www.cnblogs.com/lakemonster/p/10496029.html