to boolean:
null、NaN、0、undefined或""?false:true
to number
undefine NaN
null或"" 0
true 1
false 0
"abc" NaN
"132" 132
Object->Ojbect.valueOf或toString(),变成原始值再进行转换
to string
object toString()
parseInt("")===NaN
to boolean:
null、NaN、0、undefined或""?false:true
to number
undefine NaN
null或"" 0
true 1
false 0
"abc" NaN
"132" 132
Object->Ojbect.valueOf或toString(),变成原始值再进行转换
to string
object toString()
parseInt("")===NaN
转载于:https://www.cnblogs.com/fredwu/archive/2012/04/26/2471206.html