(count!= null)vs javascript中的if(!count)

Pra*_*ant -3 javascript

我发现了这个地方:而不是if (count != undefined && count != null),使用if(count != null).我可以使用if (count == null)if(!count)互换?

Ry-*_*Ry- 5

count != undefined && count != null完全相同一样count != null.!count如果是真实的countnull,undefined,0,NaN,空字符串,或false.