js优雅判断undefined、null、空字符串、0小技巧,直接用if(obj)
undefined、null、空字符串、0在js中全部为假
let obj=undefined
if(obj)
{
...
}
本文来自博客园,作者:HumorChen99,转载请注明原文链接:https://www.cnblogs.com/HumorChen/p/18039716
undefined、null、空字符串、0在js中全部为假
let obj=undefined
if(obj)
{
...
}
本文来自博客园,作者:HumorChen99,转载请注明原文链接:https://www.cnblogs.com/HumorChen/p/18039716