http://www.cnblogs.com/mountain-mist/articles/1600995.html
我们在 DOM 应用中,一般只需要用 (!exp) 来判断就可以了,因为 DOM 应用中,可能返回 null,可能返回 undefined,如果具体判断 null 还是 undefined 会使程序过于复杂。
typeof 返回的是字符串,有六种可能:"number"、"string"、"boolean"、"object"、"function"、"undefined"
本文探讨了在DOM应用中使用(!exp)来判断null和undefined的方法,解释了typeof操作符返回的六种可能类型,并强调了具体判断这两种情况可能导致的程序复杂性增加。
http://www.cnblogs.com/mountain-mist/articles/1600995.html
我们在 DOM 应用中,一般只需要用 (!exp) 来判断就可以了,因为 DOM 应用中,可能返回 null,可能返回 undefined,如果具体判断 null 还是 undefined 会使程序过于复杂。
typeof 返回的是字符串,有六种可能:"number"、"string"、"boolean"、"object"、"function"、"undefined"
641
1185

被折叠的 条评论
为什么被折叠?