Implicit Primitive Type Conversion Rule
来源:互联网 发布:受人冷落的网络词语 编辑:程序博客网 时间:2024/06/08 14:25
Value
Converted to:
String
Number
Boolean
Object
undefined
"undefined"
NaN
false
throws TypeError
null
"null"
0
false
throws TypeError
true
"true"
1
True
new Boolean(true)
"false"
0
false
new Boolean(false)
"" (empty string)
0
false
new String("")
"1.2" (nonempty, numeric)
1.2
true
new String("1.2")
"one" (nonempty, non-numeric)
NaN
true
new String("one")
0
"0"
false
new Number(0)
-0
"0"
false
new Number(-0)
NaN
"NaN"
false
new Number(NaN)
Infinity
"Infinity"
true
new Number(Infinity)
-Infinity
"-Infinity"
true
new Number(-Infinity)
1 (finite, non-zero)
"1
true
new Number(1)
{} (any object)
see §3.8.3
see §3.8.3
true
[] (empty array)
""
0
true
[9] (1 numeric elt)
"9"
9
true
['a'] (any other array)
use join() method
NaN
true
function(){} (any function)
see §3.8.3
NaN
true
- Implicit Primitive Type Conversion Rule
- Widening Primitive Conversion & Narrowing Primitive Conversion
- Implicit conversion from enumeration type 'enum CGImageAlphaInfo' to different enumeration type 'CGB
- Implicit conversion from enumeration type 'enum CGImageAlphaInfo' to different enumeration type 'CGB
- Implicit conversion from enumeration type 'enum CGImageAlphaInfo' to different enumeration type 'CGB
- 【IOS异常汇总】之 implicit conversion of Object-C pointer type"NSString *" to C pointer type "const void *"
- Beware the C++ implicit conversion
- overflow in implicit constant conversion
- Primitive, referrence and Value Type
- copvalue from wrapper type to primitive type
- copvalue from wrapper type to primitive type
- implicit conversion of (cl & gcc & g++)
- [iOS开发] Implicit conversion loses integer precision
- Type-Conversion in Javascript
- Data type conversion
- C++ frequent type conversion
- matlab Data Type Conversion
- 第二节:原生数据类型 Primitive Data Type
- Java中“泛型之泛型类、泛型方法“和'泛型通配符"的应用总结
- effective stl 第一部分:容器
- 初试cocos2d-x,编译运行cocos2d-x范例的过程和遇到的问题。
- OCP-1Z0-新051-61题版本-22
- iOS异步请求下载图片
- Implicit Primitive Type Conversion Rule
- Win7 + VirtualBox 安装 MacOS X 10.9 Mavericks 操作步骤
- 黑马程序员_事件
- java 各阶段书籍
- CSDN设置头像后,还是显示原来的头像
- keytool - 密钥和证书管理工具(三)
- sql动态行转列
- 谦卑的架构师
- 虚幻脚本预处理器