当前位置:网站首页>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语言——常量、变量
![[CISCN2019 华东南赛区]Web11 1](/img/94/61ad4f6cbbd46ff66f361462983d7a.png)
[CISCN2019 华东南赛区]Web11 1

一本通1201——斐波那契数列

「PHP基础知识」PHP中的标记

下载url-loader,用limit指定图片大小后,显示不出图片

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

First knowledge of C language - why does every C program have a main function

页面的基本布局

页面布局中元素定位的几种方式

Share a multiple-choice question about variables (including global variables, local variables, the scope of variables, and life cycle knowledge points)
随机推荐
GCC compilation options
JS中for...of和for...in的区别
迭代器和生成器
Program environment and preprocessing (Part 2): define, undef, command line compilation, conditional compilation, file inclusion (super full collation, recommended collection!!!
User management - paging
编辑删除用户
块,行内块元素之间存在间隙
Gallerycms download, installation and configuration
[C language switch branch statement and loop statement]
First knowledge of C language - why does every C program have a main function
User registration login
SQL (MySQL) rookie tutorial knowledge
First acquaintance with C language - first acquaintance with pointer
「PHP基础知识」PHP中的标记
【codeforces 1695C Zero Path】DP
Introduction to C language
Page configuration
arguments
XSS知识点
初识C语言——什么是C语言