StupidBeauty
Read times:763Posted at:Sat Aug 31 21:55:21 2013
- no title specified

转载:JS 中如何判断-null

Var1为null或undefined时,( !Var1 )会返回真。所以如果不需要区分null还是undefined,则可以直接使用( !Var1 )来做判断。

http://www.cftea.com/c/2007/04/YK4PY29JW82CZOVY.asp

亮点:

exp 为 undefined 时,也会得到与 null 相同的结果,虽然 null 和 undefined 不一样。注意:要同时判断 null 和 undefined 时可使用本法。

var exp = null;
if (!exp)
{
alert("is null");
}

未知美人

Your opinions
Your name:Email:Website url:Opinion content:
- no title specified

HxLauncher: Launch Android applications by voice commands

 
Recent comments
2017年4月~2019年4月垃圾短信排行榜Posted at:Thu Sep 26 04:51:48 2024
Qt5.7文档翻译:QWebEngineCookieStore类,QWebEngineCookieStore ClassPosted at:Fri Aug 11 06:50:35 2023盲盒kill -9 18289 Grebe.20230517.211749.552.mp4