当前位置:网站首页>8.==与===?
8.==与===?
2022-07-21 11:38:00 【yingxingyf】
===
1、如果类型不同,就[不相等]
2、如果两个都是数值,并且是同一个值,那么[相等]。
3、如果两个都是字符串,每个位置的字符都一样,那么[相等];否则[不相等]
4、如果两个值都是true,或者都是false,那么[相等]。
5、如果两个值都引用同一个对象或函数,那么[相等];否则[不相等]。
6、如果两个值都是null,或者都是undefined,那么[相等]。
==
1、如果两个值类型相同,进行=== 比较。
2、如果两个值类型不同,他们可能相等。根据下面规则进行类型转换再比较
a、如果一个是null、一个是undefined,那么[相等]。
b、如果一个是字符串,一个是数值,把字符串转换成数值再进行比较。
c、如果任一值是true,把它转换成1 再比较;如果任一值是false,把它转换成0 再比较。
d、任何其他组合,都[不相等]。
边栏推荐
- Json 格式的接口测试该怎么做?
- 手握趣店100亿现金,罗敏决定再赌一把
- 【附下载】漏洞扫描工具AppScan安装及功能简单使用
- A free music listening and downloading player
- 面试官:请你实现一下map / filter / reduce | 数据基础方法的模块化实现
- ionic4学习笔记5--自定义公共模块
- 神牛TT685C闪光灯ETTL模式不同步解决方案
- 使用shell将一个目录的所有文件移动以年月为名的文件夹中
- libpng error: iTXt: chunk data is too large error: PNG unsigned integer out of range
- 如何解开和反编译思科cisco的交换机固件
猜你喜欢
[零基础] 减少50%的bug,只需要30分钟...
ionic4学习笔记8--UI组件2列表(没有实践,直接摘抄)
Countdownlatch, cyclicbarrier, semaphore of concurrent programming
Thesis reading: ctrl: a conditional transformer language model for controllable generation
互联网大厂为何都爱“送外卖”?
epoch,batch_size
xxl-job(2.3.0)分布式任务bean模式,GLUE shell调度实践,源码debug
ArgoCD 用户管理、RBAC 控制、命令行登录、App 同步
Defineexpose, the parent component gets the attribute value in the child component
Thesis reading: dialogpt
随机推荐
The highest state of pulling wool, liberate your hands
Thesis reading: ctrl: a conditional transformer language model for controllable generation
Top understanding notes of LSTM
Implementing DDD based on ABP -- domain service, application service and dto practice
使用sql批量修改MacOs照片应用(Photos)上的照片时间
Wuxi launched a major investigation of potential food safety hazards in Pizza Hut stores in the city
判断是否二叉搜索树
ionic4学习笔记8--UI组件2列表(没有实践,直接摘抄)
Judge whether the binary tree is symmetric
Some skills about open, read, write, close in hook unistd
Summary of best practices for openfegin/restemplate microservice invocation
Image text cross modal fine-grained semantic alignment confidence correction mechanism aaai2022
web服务器
[CCF CSP] 201409-1 adjacent pairs
influxdb
Zhongchang loses the vegetable basket
二叉搜索树与双向链表
实现div选中效果
VAD简单总结
Compile php7 to specify the Remi extension directory and the configuration directory of ini