js中的true和false

1、false

undefined、NaN、0、null和空字符串''均被视为false

2、true

除上述以外的其它情况一律被视作true

原文地址:https://www.cnblogs.com/lhyhappy365/p/6076512.html