当前位置:网站首页>js强制转换
js强制转换
2022-06-26 17:23:00 【丹丹的小跟班】
数字和其他类型数据进行比较时,会把其他类型数据转换为数字进行比较(有些数据类型,比如数组会先使用toString转换为字符串,最后再转换为数字)。
布尔值和其他数据类型进行比较时,会优先将布尔值转换为数字,然后再将其他数据类型转换为数字进行比较,也就是进行上一个规则的操作。
undefined 除了和null进行非全等比较返回true,其它均返回false。null 除了和 undefined进行非全等比较返回true,其它均返回false。
数组(或对象)和字符串进行比较时,数组(或对象)会转换成字符串再进行比较。
使用Boolean()进行转换时,如果省略或值0,-0,null,false,NaN,undefined,或空字符串(""),该对象具有的初始值false。所有其他值,包括任何对象,空数组([])或字符串"false",都会创建一个初始值为true的对象。
边栏推荐
- 量化合约系统开发分析案例丨合约量化系统开发方案详解
- 国信证券怎么开户?通过链接办理股票开户安全吗
- Implementation of MySQL master-slave architecture
- Daily record 2
- Sandboxed container: container or virtual machine
- Can Luo Yonghao succeed in entering the AR field this time?
- The latest masterpiece of Alibaba, which took 182 days to produce 1015 pages of distributed full stack manual, is so delicious
- Calculate the average of N numbers in the group indexed by the formal parameter x, move the data less than the average in the group indexed to the front of the array, and move the data greater than or
- Platform management background and merchant menu resource management: merchant registration management design
- SIGIR 2022 | 港大等提出超图对比学习在推荐系统中的应用
猜你喜欢

Treasure and niche CTA animation material website sharing

Environment setup mongodb

Leetcode 1170. Frequency of occurrence of the minimum letter of the comparison string (yes, solved)

Teach you to learn dapr - 1 The era of net developers

Basic requirements: 7 problems in singleton mode

Rich professional product lines, and Jiangling Ford Lingrui · Jijing version is listed

Classical synchronization problem

去中心化NFT交易协议将击败OpenSea

MySQL add column failed because there was data before, not null by default

Teach you to learn dapr - 3 Run the first with dapr Net program
随机推荐
Discussion: the next generation of stable coins
[code Capriccio - dynamic planning] t583. Deleting two strings
关于FlowUs这一款国民好笔记
Various types of gypsum PBR multi-channel mapping materials, please collect them quickly!
The student record consists of student number and academic performance. The data of n students have been stored in the a structure array to find out the student record with the lowest performance
[ten thousand words summary] starting from the end, analyze in detail how to fill in the college entrance examination volunteers
A simple membership card management system based on Scala
【代码随想录-动态规划】T583、两个字符串的删除操作
Over the weekend: 20000 words! Summary of JVM core knowledge, 18 serial cannons as a gift
量化合约系统开发分析案例丨合约量化系统开发方案详解
Demonstrate to Xiaobai the case of sub database and sub table
Vue--vuerouter cache routing component
Can Luo Yonghao succeed in entering the AR field this time?
10 cloud security best practices that enterprises need to know
类型多样的石膏PBR多通道贴图素材,速来收藏!
Comp281 explanation
Leetcode 1169. Query invalid transactions (if the amount of data is small, this problem still needs to be solved by violent enumeration)
Necessary decorator mode for 3 years' work
mysql Add column 失败 因为之前有数据,不是默认null 不行
Calculate the average of N numbers in the group indexed by the formal parameter x, move the data less than the average in the group indexed to the front of the array, and move the data greater than or