32+32 //64對象
"32"+32 //"3232"字符串
"32"-32 //0string
"32"-0 //32 (將字符串轉換爲數字)it
7-"a" //NaNobject
"a"-"b" //NaN字符
+{}[true] //NaN數字
!{}[true] //truenew
+!{}[true] // 1undefined
+[1] //1
+[1,2] //NaN
7/0 // Infinity
!null // true
!undefined //true
!NaN //true
"1.23"==1.23 //true (嘗試string轉number)
0==false //true (嘗試boolean轉number)
0==null //false
null==undefined //true
null==false //false
new Object()==new Object() //true
[1,2]==[1,2] //true
new String("hi")=="hi" //true (object==number|string嘗試對象轉爲基本類型)
全等"==="
類型不一樣,返回false;
類型相同:
NaN≠NaN
new Object≠new Object
null===null
undefined===undefined