当前位置:网站首页>Js== mandatory type conversion provisions of operators
Js== mandatory type conversion provisions of operators
2022-07-27 05:41:00 【weixin_ forty-six million fifty-one thousand two hundred and si】
First, judge whether the two types are the same , If it's not the same , Will perform type conversion and then compare , If the same, directly compare
Conversion situation
1) Comparison between strings and numbers , First convert the string to a number and then compare the size
2) Equality comparison between other types and Boolean types , First convert Boolean values to numbers , Apply other rules to compare
3)null and undefined An equal comparison between , The result is true , Other values are compared with them and return false values
4) Equality comparison between objects and non objects , The object will be converted to basic data type first (toString) Then judge
5) If both operation values are objects , Then what they compare is 《 Whether to point to the same object 》, If two operands point to the same object , The equality operator returns true, Otherwise return to false
边栏推荐
猜你喜欢

C语言初阶——分支语句(if,switch)

分享力扣—189.轮转数组 的三种解法

初识C语言——为什么每个C程序都有一个main函数

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)

Gallerycms download, installation and configuration

「PHP基础知识」PHP语句和语句块

C language string function: StrCmp, strncpy, strncat, strncmp, strstr, strtok, strError

User login - and create and verify SMS verification code

用户页面管理

深度优先搜索(dfs)简介
随机推荐
「PHP基础知识」字符串型(string)的使用
Edit delete user
Program environment and preprocessing (Part 1): how does a program run successfully?
广(宽)度优先搜索
信息学奥赛一本通1178题——成绩排序
First knowledge of C language -- what is C language
arguments
JS中如何判断一个对象是空对象
C语言指针入门详细介绍
「PHP基础知识」PHP中的标记
Permission display - dynamic list on the left
迭代器和生成器
GalleryCMS下载安装与配置
正则表达式
下载url-loader,用limit指定图片大小后,显示不出图片
一本通1353——表达式括号匹配(栈)
Introduction to C language
Time complexity and space complexity
C language elementary level -- branch statement (if, switch)
Maintain login and route jump