【发布时间】:2016-08-18 09:42:07
【问题描述】:
我在某个地方找到了这个:使用 if(count != null) 代替 if (count != undefined && count != null)。 if (count == null) 和 if(!count) 可以互换使用吗?
【问题讨论】:
-
count != undefined && count != null与count != null完全相同。如果count是null、undefined、0、NaN、空字符串或false,则!count为真。 (在我寻找副本时转换为答案)
标签: javascript