实际上是否有可能将Null
数据类型作为typeof
函数的返回值 - 如果是这样的话,什么情况下会产生该结果,什么时候变量实际上是该 Null
类型的?
typeof myVAR; //gives me "undefined" before the variable declaration
var myVAR;
typeof myVAR; //also gives me "undefined"
myVAR = null; //assigned the null object
typeof myVAR; //gives me "Object" (which I guess makes sense because `null` is an object and that's what I assigned to the variable)