当前位置:网站首页>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
边栏推荐
猜你喜欢

Some problems of ArcGIS Engine Installation

flex弹性盒子

Review of metallurgical physical chemistry -- Fundamentals of metallurgical reaction kinetics and characteristics of multiphase reaction kinetics

基于php心理健康服务系统获取(php毕业设计)

c语言:通过一个例子来认识函数栈帧的创建和销毁讲解

书籍-清醒思考的艺术

书籍-乌合之众

结果填空 凑算式(DFS*C语言)

wangeditor(@4.7.15)-轻量级的富文本编辑器

Zotero - a document management tool
随机推荐
基于Highcharts平台的桑基图(Sankey diagram)绘制
GD32F407 移植FreeRTOS+Lwip
结果填空 煤球数目
JS数组的方法大全
基于XMind的E-R图制作
抖音-视频步骤
new,let,var,const以及暂时性死区,xml和json的区别
SVG了解与绘图应用
Cad-gis data conversion
DOM——页面的渲染、style属性操作、预加载与懒加载、防抖与节流
树莓派WIFI一键连接配置
DOM操作的案例
设置滚动条
HDU-1284:钱币兑换问题 推理+动态规划(dp)
【uni-app】uni-app中scroll-into-view的使用
(php毕业设计)基于php用户在线投稿管理系统获取
结果填空 凑算式(DFS*C语言)
基于Easy CHM和VS的帮助文档制作
wangeditor(@4.7.15)-轻量级的富文本编辑器
ArcGIS Engine开发资源