var a ="b";

console.log (typeof(a) == "undefined")

console.log (typeof(b) == "undefined")


typeof  与字符"undefined" 进行比较 

更多推荐