null,'',0,undefined,==,=== 之間的比較
標簽:
JavaScript
1.类型
typeof null 结果为'object';
typeof undefined 结果为'undefined';
typeof '' 结果为'string';
typeof 0 结果为'number';
2.关系
null==undefined 结果为true
0=='' 结果为true
null==0 结果为false
null=='' 结果为false
undefined==0 结果为false
undefined=='' 结果为false
3.==与===
null===undefined 结果为false
0==='' 结果为false
由此可以看到===不同于==的是,==是值的比较,===除了值的比较以外还有类型的比较
點擊查看更多內容
3人點贊
評論
評論
共同學習,寫下你的評論
評論加載中...
作者其他優質文章
正在加載中
感謝您的支持,我會繼續努力的~
掃碼打賞,你說多少就多少
贊賞金額會直接到老師賬戶
支付方式
打開微信掃一掃,即可進行掃碼打賞哦