当前位置:网站首页>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>
边栏推荐
- Win11时间怎么显示星期几?Win11怎么显示今天周几?
- Crawler (17) - Interview (2) | crawler interview question bank
- 嵌入式开发:如何为项目选择合适的RTOS?
- Nine degree 1201 - traversal of binary sort number - binary sort tree "suggestions collection"
- Static test tool
- Demon daddy A3 stage near normal speed speech flow initial contact
- What stocks can a new account holder buy? Is the stock trading account safe
- Contour layout of margin
- Lingyun going to sea | saihe & Huawei cloud: jointly help the sustainable development of cross-border e-commerce industry
- Backup tidb cluster to persistent volume
猜你喜欢

大数据开源项目,一站式全自动化全生命周期运维管家ChengYing(承影)走向何方?
![Jerry's about TWS pairing mode configuration [chapter]](/img/fd/dd1e252617d30dd7147dbab25de5b4.png)
Jerry's about TWS pairing mode configuration [chapter]

Reptile combat (VII): pictures of the king of reptiles' heroes

反爬通杀神器
Talk about relational database and serverless

How to turn on win11 game mode? How to turn on game mode in win11

The little money made by the program ape is a P!

Validutil, "Rethinking the setting of semi supervised learning on graphs"

【Azure微服务 Service Fabric 】如何转移Service Fabric集群中的种子节点(Seed Node)

NVR hard disk video recorder is connected to easycvr through the national standard gb28181 protocol. What is the reason why the device channel information is not displayed?
随机推荐
[open source] Net ORM accessing Firebird database
Win11时间怎么显示星期几?Win11怎么显示今天周几?
Ten thousand word summary data storage, three knowledge points
Which financial products will yield high returns in 2022?
Demon daddy A1 speech listening initial challenge
【JDBC Part 1】概述、获取连接、CRUD
Validutil, "Rethinking the setting of semi supervised learning on graphs"
MIT6.S081-Lab9 FS [2021Fall]
Backup tidb cluster to persistent volume
【Azure微服务 Service Fabric 】如何转移Service Fabric集群中的种子节点(Seed Node)
Debugging and handling the problem of jamming for about 30s during SSH login
Where is the big data open source project, one-stop fully automated full life cycle operation and maintenance steward Chengying (background)?
Reinforcement learning - learning notes 9 | multi step TD target
【Azure微服务 Service Fabric 】因证书过期导致Service Fabric集群挂掉(升级无法完成,节点不可用)
TCP/IP 协议栈
What if the win11u disk does not display? Solution to failure of win11 plug-in USB flash disk
Code of "digital image processing principle and Practice (matlab version)" part2[easy to understand]
How to make agile digital transformation strategy for manufacturing enterprises
Win11如何解禁键盘?Win11解禁键盘的方法
怎样写一个增广矩阵到txt文件中