null instanceof Object
时间: 2024-01-30 14:33:48 浏览: 122
谈谈我对JavaScript中typeof和instanceof的深入理解
null instanceof Object的结果是false。\[1\]\[2\]尽管typeof null返回"object",但是null并不是以Object为原型创建出来的,因此null不是Object的实例。null是JavaScript中用来表示空引用的特殊值,而不是一个真正的对象。因此,null instanceof Object的结果是false。
#### 引用[.reference_title]
- *1* [JavaScript 中遇到 “null instanceof Object ” 的返回值为什么是 false 呢 ???](https://blog.csdn.net/weixin_44586544/article/details/112724435)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* *3* [JavaScript中遇到“null instanceof Object ”返回值为false的解释](https://blog.csdn.net/weixin_42049636/article/details/81565461)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文