当前位置:网站首页>==,===,Object.is
==,===,Object.is
2022-07-27 05:03:00 【weixin_46051260】
- ==,如果两边的类型不一致,进行强制类型转换,然后再去比较
console.log(1=='1');//true
console.log(1==true);//true
- ===,如果两边的类型不一致,不会进行强制类型转换,直接返回false。等型等值
console.log(1===true);//false
console.log(1==='1');//false
console.log(NaN===NaN);//false
console.log(+0===-0);//true
- Object.is():用来判断两个值是否严格相等,处理一些特殊情况,-0和+0不再相等,两个NaN是相等的
console.log(Object.is(1,'1'));//false
console.log(Object.is(NaN,NaN));//true
边栏推荐
- C language string introduction and related operation functions
- pytorch安装新坑
- 函数和箭头函数
- 弹性盒/伸缩盒(flex)的使用
- Time complexity and space complexity
- Flask的使用
- Notes series k8s orchestration MySQL container - stateful container creation process
- C语言做一个小迷宫
- Li Hongyi machine learning team learning punch in activity day05 --- skills of network design
- map结构
猜你喜欢

Share a multiple-choice question about the process of program compilation (including a brief discussion on the compilation process, the formation and merging process of symbol tables)

初识C语言——什么是C语言

封装JWT

Source code of document type full-text retrieval knowledge base management system

初识C语言——字符串+转义字符+注释

小米商城项目_注册

Li Hongyi machine learning team learning punch in activity day02 --- return

Hi3516dv300 environment setup

elment-ui使用方法

DNSmasq使用总结
随机推荐
图片上传的逻辑
node 安装调试
商品图片的管理
【codeforces round#800 B. Paranoid String】DP
背景图片相关应用-铺满,自适应
创建项目 实现登录注册,生成jwt,发送验证码
Day4 --- Flask 蓝图与Rest-ful
我的第一篇博客
Li Hongyi machine learning team learning punch in activity day01 --- introduction to machine learning
SQL(MySql)菜鸟教程知识
C language makes a small maze
js进阶知识—函数
【C语言switch分支语句和循环语句】
Flask登录实现
Carmaker quick start lesson 4 developing 48V P1 hybrid system
Flask请求数据获取与响应
First knowledge of C language -- constants and variables
流程控制-分支
SQL database → constraint → design → multi table query → transaction
订单系统功能实现