当前位置:网站首页>The difference between null and undefined
The difference between null and undefined
2022-07-28 05:51:00 【Still love me】
Java Object Class is the parent of all classes , in other words Java All classes of inherit Object, Subclasses can use Object All the ways .
null and undefined The difference between
1、 First, the data types are different
console.log(typeof null) //object
console.log(typeof undefined) //undefined
2、null and undefined Both equal , But when the two make a congruent comparison , The two are not equal .( Because their data types are different )
console.log(null==undefined) //ture
console.log(null===undefined) //false
3、 Converted to different numbers
console.log(Number(null)) //0
console.log(Number(undefined)) //NaN
console.log(Number(22+null)) //22
console.log(Number(22+undefined)) //NaN
4、null representative “ empty ”, For null pointer ;undefined Is defined without assignment
var a;
console.log(a);//undefined
var b=null;
console.log(b);//null
边栏推荐
猜你喜欢

Microsoft Edge浏览器插件(2)

Merge two ordered arrays of order table OJ

Making E-R diagram based on XMIND

书籍-清醒思考的艺术

DOM——页面的渲染、style属性操作、预加载与懒加载、防抖与节流

Zotero - a document management tool

ArcMap map map projection related operations

Global event bus

链表中关于快慢指针的oj题

uniapp问题:“navigationBarTextStyle“报错:Invalid prop: custom validator check failed for prop “navigat
随机推荐
结果填空 星系炸弹(Excel秒杀)
Merge two ordered arrays of order table OJ
C语言回顾(指针篇)
Microsoft edge browser plug-in (2)
渐进增强和优雅降级
js-简单的发布订阅类
c语言:通过一个例子来认识函数栈帧的创建和销毁讲解
(php毕业设计)基于php学生作业提交管理系统获取
树莓派串口
基于php学生学籍管理系统获取(php毕业设计)
NRF51822 回顾总结
标准C语言学习总结3
ArcMap map map projection related operations
标准C语言学习总结5
书籍-聪明的投资者
ArcGIS Engine Development Resources
树莓派WIFI一键连接配置
flex弹性盒子项目属性
Implementation of date class and its basic functions
ArcMap地图投影相关操作