課程
/前端開發
/JavaScript
/JavaScript深入淺出
請問老師,在js中不是不區分undefined和null嗎,為啥typeof里又不一樣。?一個返回的是undefined一個是object
2019-04-19
源自:JavaScript深入淺出 1-5
正在回答
null:空值,常用來描述空值;關鍵字;
??????typeof?null:'object'
??????undefined:變量沒有初始化;沒有這個屬性或者屬性不存在;
??????typeof?undefined'undefined'
在js中區分underfined和null啊
舉報
由淺入深學習JS語言特性,且解析JS常見誤區,從入門到掌握
1 回答undefined和null不也可以嗎???那里有問題??
2 回答javascript中type()和typeof()有什么區別?
3 回答typeof NAN 運算結果是“undefined”
3 回答JS中‘==’和‘===’的區別
1 回答typeof方法為啥判斷數組元素是不是數組類型?
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2019-10-11
null:空值,常用來描述空值;關鍵字;
??????typeof?null:'object'
??????undefined:變量沒有初始化;沒有這個屬性或者屬性不存在;
??????typeof?undefined'undefined'
2019-04-20
在js中區分underfined和null啊