当前位置:网站首页>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
边栏推荐
- MySQL修改字段语句
- Programmer vs hacker thinking | daily anecdotes
- Brief introduction to class loading process
- Arthas source code learning-1
- [paper notes] semi supervised object detection (ssod)
- Weka download and installation
- Es data synchronization mode
- Solve valueerror: invalid literal for int() with base 10
- Detailed summary of reasons why alertmanager fails to send alarm messages at specified intervals / irregularly
- (2) Relational database
猜你喜欢
Download and installation tutorial of consumer
Kali SSH Remote Login
For the first time in Chinese universities! Unique in the world! Tongji students win international awards
5 connection modes of QT signal slot
Paddlepaddle paper reproduction course biggan learning experience
剑指 Offer 03. 数组中重复的数字
Using R language in jupyter notebook
Principle and implementation of MySQL master-slave replication (docker Implementation)
Summary of regularization methods
[paper notes] mcunetv2: memory efficient patch based influence for tiny deep learning
随机推荐
股票开户用什么app最安全?知道的给说一下吧
剑指 Offer 10- I. 斐波那契数列
Sword finger offer 06 Print linked list from end to end
Yolov4 coco pre train Darknet weight file
Arthas, a sharp tool for online diagnosis - several important commands
04. binary tree
If a thread overflows heap memory or stack memory, will other threads continue to work
MySQL transaction characteristics and implementation principle
Mapbox map - inconsistent coordinate system when docking GIS layers?
Simulating Sir disease transmission model with netlogo
MySQL performance optimization - index optimization
MySQL修改字段语句
Record the time to read the file (the system cannot find the specified path)
Thread - learning notes
Websocket (WS) cluster solution
剑指 Offer 09. 用两个栈实现队列
Sword finger offer II 091 Paint the house
Talk about the creation process of JVM objects
QT excel table read / write library - qtxlsx
QT source code online view