var x; if(x == null) { alert("null"); }
var x; if(typeof(x) == "undefined") alert("undefined");
var x; if(!x) { alert("不x"); }
推荐最后一种方法。
var x; if(x == null) { alert("null"); }
var x; if(typeof(x) == "undefined") alert("undefined");
var x; if(!x) { alert("不x"); }
推荐最后一种方法。