专注收集记录技术开发学习笔记、技术难点、解决方案
网站信息搜索 >> 请输入关键词:
您当前的位置: 首页 > VSTS

JavaScript - null VS undefined

发布时间:2011-06-20 18:22:27 文章来源:www.iduyao.cn 采编人员:星星草
JavaScript ---- null VS undefined
共同点:
1, null and undefined both indicate an absence of value.
2. Both are falsy values-----they behave like false when a boolean value is required.
3. Neither null or undefined have any properties or methods.

不同点:
1. The equality operator== considers them to be equal.
   Use the strict equality operator === to distinguish them
2. You might consider undefined to represent a system-level, unexpected, or error-like absence of value.
   Null to represent program-level, normal, or expected absence of value.
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。

其他相似内容:

热门推荐: