判斷對象有兩種格式
1.if(typeof obj == "string"){}
2.if(obj.constructor == "String"){}
判斷對象類型表
變量 typeof判斷 constructor判斷
{an;"obj"} object Object
["an","ary"] array Array
function(){} function Function
"a string" string String
555555 number Number
true boolean Boolean
new User() object User