当前位置:网站首页>Differences between = = and = = = in JS (detailed explanation)
Differences between = = and = = = in JS (detailed explanation)
2022-06-25 15:40:00 【Fairy-KunKun】
Simply speaking :== It means the same ,=== The representation is strictly the same , Why do you say that
I understand that : When making a double equal sign comparison : First check the two operands data types , If the same , Is to === Compare , If different , Is willing to do a type conversion for you , Convert to the same type and then compare , and === When comparing , If the type is different , Is directly false.
Operands 1 == Operands 2, Operands 1 === Operands 2
Comparison process :
Double equal sign ==:
(1) If the two value types are the same , Three more equal signs (===) Comparison
(2) If the two value types are different , It could be the same , The following rules are needed for type conversion in comparison :
1) If one is null, One is undefined, So equal
2) If one is a string , One is numerical value , Convert the string to a numeric value before comparing
Three equal signs ===:
(1) If the type is different , It must not be equal
(2) If both are numerical , And it's the same value , So equal ; If at least one of them is NaN, So it's not equal .( Judge whether a value is NaN, Only use isNaN() To judge )
(3) If both are strings , The characters in each position are the same , So equal , Otherwise it's not equal .
(4) If both values are true, or false, So equal
(5) If both values refer to the same object or function , So equal , Otherwise it's not equal
(6) If both values are null, or undefined, So equal
边栏推荐
- Es data synchronization mode
- Arthas, a sharp tool for online diagnosis - several important commands
- 剑指 Offer 03. 数组中重复的数字
- google_ Breakpad crash detection
- Netlogo learning
- Shared memory synchronous encapsulation
- 0706-- replace fields in the use case, such as mobile phone number or ID
- Source code analysis of nine routing strategies for distributed task scheduling platform XXL job
- Basic syntax and common commands of R language
- QT source code online view
猜你喜欢

VectorDraw Developer Framework 10.1001 Crack

Sword finger offer 03 Duplicate number in array
How to debug grpc by postman

Could not connect to redis at 127.0.0.1:6379 in Windows

Several relationships of UML

到底要不要去外包公司?这篇带你全面了解外包那些坑!

异步处理容易出错的点

解决Visio和office365安装兼容问题

剑指 Offer 04. 二维数组中的查找

Programmer vs hacker thinking | daily anecdotes
随机推荐
[paper notes] contextual transformer networks for visual recognition
Esp8266 building smart home system
Sword finger offer 07 Rebuild binary tree
What is the safest app for stock account opening? Tell me what you know
Brief introduction to class loading process
剑指 Offer 05. 替换空格
Summary of common methods of ArrayList, LinkedList and vector, and analysis of source code learning
Client development (electron) system level API usage 2
golang使用mongo-driver操作——增(进阶)
MySQL修改字段语句
Basic syntax and common commands of R language
解析数仓lazyagg查询重写优化
Solve the go project compilation error go mod: no such file or directory
Shared memory synchronous encapsulation
Solve valueerror: invalid literal for int() with base 10
到底要不要去外包公司?这篇带你全面了解外包那些坑!
If a thread overflows heap memory or stack memory, will other threads continue to work
golang reverse a slice
通过客户经理的开户链接开股票账户安全吗?
Do you want to go to an outsourcing company? This article will give you a comprehensive understanding of outsourcing pits!