当前位置:网站首页>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>
边栏推荐
- Main functions of OS, Sys and random Standard Libraries
- Meta force force meta universe system development fossage model
- The cyberspace office announced the measures for data exit security assessment, which will come into force on September 1
- Description of the difference between character varying and character in PostgreSQL database
- DNS series (I): why does the updated DNS record not take effect?
- Take the intersection of two sets
- Demon daddy A1 speech listening initial challenge
- Display optimization when the resolution of easycvr configuration center video recording plan page is adjusted
- Tsconfig of typescript TS basics JSON configuration options
- Contour layout of margin
猜你喜欢
![[advanced MySQL] index details (I): index data page structure](/img/e7/fe4591a721a71c3c38d6e4448af6af.png)
[advanced MySQL] index details (I): index data page structure
![Jerry's about TWS channel configuration [chapter]](/img/94/fde5054fc412b786cd9864215e912c.png)
Jerry's about TWS channel configuration [chapter]

Demon daddy B3 read extensively in a small amount, and completed 20000 vocabulary+
Preparing for the interview and sharing experience

648. Word replacement

Reptile combat (VII): pictures of the king of reptiles' heroes
![[开源] .Net ORM 访问 Firebird 数据库](/img/a2/4eff4f0af53bf3b9839a73019a212f.png)
[开源] .Net ORM 访问 Firebird 数据库

Dry goods sharing | devaxpress v22.1 original help document download collection

强化学习-学习笔记9 | Multi-Step-TD-Target

大数据开源项目,一站式全自动化全生命周期运维管家ChengYing(承影)走向何方?
随机推荐
Jerry's fast pairing does not support canceling pairing [article]
The latest Android interview collection, Android video extraction audio
Demon daddy A1 speech listening initial challenge
Which futures company is the safest to open a futures account?
An in-depth understanding of fp/fn/precision/recall
Crawler (17) - Interview (2) | crawler interview question bank
Validutil, "Rethinking the setting of semi supervised learning on graphs"
[开源] .Net ORM 访问 Firebird 数据库
Demon daddy B2 breaks through grammar and completes orthodox oral practice
Restore backup data on persistent volumes
【JDBC Part 1】概述、获取连接、CRUD
Use br to back up tidb cluster data to azure blob storage
Implementation method of data platform landing
Magic weapon - sensitive file discovery tool
Jerry's configuration of TWS cross pairing [article]
South China x99 platform chicken blood tutorial
Build your own website (18)
Meta force force meta universe system development fossage model
用语雀写文章了,功能真心强大!
Reinforcement learning - learning notes 9 | multi step TD target