当前位置:网站首页>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的对象。
边栏推荐
- 【uniapp】uniapp手机端使用uni.navigateBack失效问题解决
- 【万字总结】以终为始,详细分析高考志愿该怎么填
- Byte interview: two array interview questions, please accept
- [recommendation system learning] recommendation system architecture
- Treasure and niche CTA animation material website sharing
- ACL 2022 | zero sample multilingual extracted text summarization based on neural label search
- 在国金证券开户怎么样?保障安全吗?
- Prometeus 2.34.0 新特性
- 【动态规划】剑指 Offer II 091. 粉刷房子
- What is the difference between digital collections and NFT
猜你喜欢

丰富专业化产品线, 江铃福特领睿·极境版上市

Sandboxed container: container or virtual machine

有依赖的背包问题

Distributed Architecture Overview

Over the weekend: 20000 words! Summary of JVM core knowledge, 18 serial cannons as a gift

She said she was tired! So tired! I want to change my career

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

【推荐系统学习】推荐系统架构
![[ten thousand words summary] starting from the end, analyze in detail how to fill in the college entrance examination volunteers](/img/77/715454c8203d722e246ed70e1fe0d8.png)
[ten thousand words summary] starting from the end, analyze in detail how to fill in the college entrance examination volunteers

Discussion: the next generation of stable coins
随机推荐
Convert the decimal positive integer m into the number in the forward K (2 < =k < =9) system and output it in bits
Quantitative contract system development analysis case - detailed explanation of contract quantitative system development scheme
Interpretation of new plug-ins | how to enhance authentication capability with forward auth
并发之Synchronized说明
Getting started with mongodb
Platform management background and merchant menu resource management: access control design of platform management background
halcon之区域:多种区域(Region)特征(5)
How about opening an account at Guojin securities? Is it safe?
Community ownership of NFT trading market is unstoppable
Teach you to learn dapr - 4 Service invocation
防火 疏散 自救…这场安全生产暨消防培训干货满满!
Army chat -- registration of Registration Center
Niuke network: Design LRU cache structure design LFU cache structure
Wechat app mall, review products, upload commodity pictures, and score Commodity Services
Necessary decorator mode for 3 years' work
Concurrent thread safety
ACL 2022 | 基于神经标签搜索的零样本多语言抽取式文本摘要
Treasure and niche CTA animation material website sharing
Jouer avec Linux et installer et configurer MySQL facilement
What is the difference between digital collections and NFT