实际上是否可以将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)
Run Code Online (Sandbox Code Playgroud) javascript ×1