当前位置:网站首页>What is the difference between the three values of null Nan undefined in JS
What is the difference between the three values of null Nan undefined in JS
2022-07-07 22:03:00 【Vayne's fat tiger】
We are JS You will definitely encounter unfamiliar faces in data types , such as NaN and undefined, about null We are Java I've been in contact with you for a long time , Then let's look at the relationship and difference between these three things through the code ?
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>null NaN undefined What is the difference between these three values </title>
</head>
<body>
<script type="text/javascript">
// == Is the equivalence operator
alert(1 == true); // true
alert(1 === true); // false
// null NaN undefined Inconsistent data types .
alert(typeof null); // "object"
alert(typeof NaN); // "number"
alert(typeof undefined); // "undefined"
// null and undefined Can be equivalent to .
alert(null == NaN); // false
alert(null == undefined); // true
alert(undefined == NaN); // false
// stay JS There are two special operators
// ==( The equivalent operator : Only judge whether the values are equal )
// ===( The congruent operator : Both judge whether the values are equal , And judge whether the data types are equal )
alert(null === NaN); // false
alert(null === undefined); // false
alert(undefined === NaN); // false
</script>
</body>
</html>
边栏推荐
- DBSync新增对MongoDB、ES的支持
- An overview of the latest research progress of "efficient deep segmentation of labels" at Shanghai Jiaotong University, which comprehensively expounds the deep segmentation methods of unsupervised, ro
- Talk about relational database and serverless
- The latest Android interview collection, Android video extraction audio
- Implementation method of data platform landing
- 使用 CustomPaint 绘制基本图形
- Using enumeration to realize English to braille
- South China x99 platform chicken blood tutorial
- Backup tidb cluster to persistent volume
- [开源] .Net ORM 访问 Firebird 数据库
猜你喜欢

Solve the problem of using uni app mediaerror mediaerror errorcode -5

Embedded development: how to choose the right RTOS for the project?
![[JDBC Part 1] overview, get connection, CRUD](/img/53/d79f29f102c81c9b0b7b439c78603b.png)
[JDBC Part 1] overview, get connection, CRUD

海外代理推荐

Win11游戏模式怎么开启?Win11开启游戏模式的方法

Win11U盘不显示怎么办?Win11插U盘没反应的解决方法
![[C language] advanced pointer --- do you really understand pointer?](/img/ee/79c0646d4f1bfda9543345b9da0f25.png)
[C language] advanced pointer --- do you really understand pointer?

L2: current situation, prospects and pain points of ZK Rollup

Ad domain group policy management

NVR硬盘录像机通过国标GB28181协议接入EasyCVR,设备通道信息不显示是什么原因?
随机推荐
QT compile IOT management platform 39 alarm linkage
怎样写一个增广矩阵到txt文件中
Using enumeration to realize English to braille
Jerry's initiation of ear pairing, reconnection, and opening of discoverable and connectable cyclic functions [chapter]
Qt编写物联网管理平台39-报警联动
解决uni-app中uni.request发送POST请求没有反应。
How to make agile digital transformation strategy for manufacturing enterprises
Solve the problem of uni in uni app Request sent a post request without response.
强化学习-学习笔记9 | Multi-Step-TD-Target
SQL injection error report injection function graphic explanation
Default constraint and zero fill constraint of MySQL constraint
双塔模型的最强出装,谷歌又开始玩起“老古董”了?
Validutil, "Rethinking the setting of semi supervised learning on graphs"
Embedded development: how to choose the right RTOS for the project?
Devil daddy B1 hearing the last barrier, break through with all his strength
Time standard library
[colmap] sparse reconstruction is converted to mvsnet format input
Open source OA development platform: contract management user manual
嵌入式开发:如何为项目选择合适的RTOS?
Jerry's power on automatic pairing [chapter]