首页 > 试题广场 >

以下Javascript代码执行后的输出结果依次是:

[单选题]
以下Javascript代码执行后的输出结果依次是:
    ```javascript
    console.log(typeof undefined == typeof NULL);
    console.log(typeof function () {} == typeof class {});
    ```

  • false, true
  • false, false
  • true, true
  • true, false
typeof null是“object” typeof NULL是undefined,太坑了
发表于 2019-01-21 17:57:43 回复(0)
null要区分大小写,typeof null 是object typeof NULL 是undefine
发表于 2019-02-24 12:57:27 回复(0)
当你试试这个就知道了
console.log( typeof NULL);
 console.log( typeof class {});
typeof NULL 返回的是undefined   ;type class{}返回的是function
发表于 2018-12-21 15:00:19 回复(0)
答案有问题吧。typeof undefined == typeof null结果为FALSE啊。前者为undefined,后者是object
发表于 2018-12-10 09:18:28 回复(3)