当前位置:网站首页>[JS foundation] logical judgment (error prone points)
[JS foundation] logical judgment (error prone points)
2022-07-22 05:35:00 【Want to be a happy repair dog】
1. null instanceof Object The result is false
- null Essentially, null Type, not Object,typeof null = ‘object’ It's a legacy of history ;
2. NaN == NaN As the result of the false
- NaN It means not a number , yes Not a Number Abbreviation , But they are also different ,NaN It's not equal to NaN And NaN Can never be equal .
3. == The judgment process :
- To determine if there is NaN, If there is , Then return directly false;
- To determine if there is Boolean, If there is ,false Convert to 0,true Convert to 1;
- null、undefined No conversion ;
4. Number The value corresponding to the type conversion
Number(’ ') = 0
Number(false) = 0
Number(undefined) = NaN
5. null == undefined As the result of the true
- ECMAScript Think : They all represent an invalid value , Indicates similar content .
6. {} === {} 、[1,2,3] === [1,2,3] As the result of the false
Address of reference type comparison , Their addresses are different .
P.S. The above explanation comes from the network , If there is something wrong with the explanation , Welcome to comment area !
边栏推荐
- Several problems faced by long-term remote work and continuous improvement of organizational automation
- What if MySQL deletion fails
- 并联型模糊PID复合控制器的simulink建模与仿真
- MySQL data addition, deletion and modification
- Pl/sql record
- 从单体架构到分布式架构,有哪些坑?
- How to pre train multimodal models using multi type data?
- C# OPC客户端代码
- 【js基础】Math中random、floor、ceil方法的使用
- Tensorflow introductory tutorial (34) -- two types of image segmentation loss functions commonly used
猜你喜欢
Write it down once Net analysis of the memory leakage of the background service of a fire Internet of things
Tensorflow入门教程(三十三)——图像分割损失函数FocalLoss
You are only one SQL statement away from the tdengine Developer Conference!
Tensorflow introductory tutorial (34) -- two types of image segmentation loss functions commonly used
【攻防世界WEB】难度一星3分入门题:get、post、robots、、cookie、button、weak、php、web、unserialize
What if MySQL deletion fails
Win11如何增强麦克风?Win11增强麦克风的设置
ES6 from getting started to mastering 06: arrow function this direction and precautions
matlab-最小二乘法拟合
国产芯片价格超低在国产替代的同时大量出口,让美国芯片深感压力
随机推荐
判断一个人靠不靠谱,就看这3点
全面败退,中国手机首次遭受重大挫折,三星和苹果则大幅增长
表情包小程序,副业日入400+
[linked list and its classic problems]
mysql数据类型
MySQL storage engine
Share an introductory guide to canvas
JS regular check can only have numbers and decimal points
Brush questions with binary tree (conclusion)
Pycocotools installation method - one step~
低代码平台搭建跨部门沟通系统案例分析
How to pre train multimodal models using multi type data?
漏洞分析丨HEVD-0x6.UninitializedStackVariable[win7x86]
FTP服务与配置
[attack and defense world web] difficulty 1-star 3-point introductory questions: get, post, robots,, cookies, buttons, weak, PHP, web, serialize
Chapter 12 principle and application of network security audit technology
Windows cannot start the mysql80 service (located on the local computer)
window 系统里 chrome 浏览器一些实用的调试技巧
国产芯片价格超低在国产替代的同时大量出口,让美国芯片深感压力
How emqx 5.0 under the new architecture of mria + rlog realizes 100million mqtt connections