通过 ! 符号进行快速判空. 适用范围: undefined , null , ""
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
</body>
<script type="text/javascript">
window.onload = function(){
var aa = null;
var bb = undefined;
var cc = "";
var dd = "1";
if(!aa){
alert(aa);
}
if(!bb){
alert(bb);
}
if(!cc){
alert(cc);
}
if(!dd){
alert(dd);
}
}
</html>