1.相同点:两者都是表示为空值。使用相等运算符时:`null == undefined` 返回的是true,要使用严格运算符(===)来区分
2.不同点:
typeof null 返回为Object
typeof undefined 返回为 undefined
1.相同点:两者都是表示为空值。使用相等运算符时:`null == undefined` 返回的是true,要使用严格运算符(===)来区分
2.不同点:
typeof null 返回为Object
typeof undefined 返回为 undefined
本文标题:js中null 与undefined的区别
本文链接:https://www.haomeiwen.com/subject/zxqauftx.html
网友评论