(美)David Flanagan. JavaScript權(quán)威指南(原書第6版) (Kindle 位置 1682-1684). Kindle 版本.嚴(yán)格相等運算符“===”首先計算其操作數(shù)的值,然后比較這兩個值,比較過程沒有任何類型轉(zhuǎn)換: ·如果兩個值類型不相同,則它們不相等。 ·如果兩個值都是null或者都是undefined,則它們不相等。我的理解null === null ,應(yīng)該返回 true。在Chrome中實驗代碼console.log(" undefined === undefined, is that true? " + (undefined === undefined));console.log(" null === null, is that true? " + (null === null));返回結(jié)果undefined === undefined, is that true? truenull === null, is that true? true請問是書上寫錯了?
JavaScritp犀牛書有錯誤? null === null 書上說不相等。
猛跑小豬
2018-12-21 19:14:17