num = 123;str = "123";alert(num == 123); //truealert(str == 123); //truealert(num === 123); //true; 值相同且类型相同alert(str === 123); //falsealert(typeof num === "number"); //truealert(typeof str === "string"); //true//数组的类型也是 objectalert(typeof []); //objectalert(typeof {}); //object//判断是否是数组的函数var isArray = function (obj) { //return obj && !(obj.propertyIsEnumerable('length')) && typeof obj === 'object' && typeof obj.length === 'number'; return obj instanceof Array;};arr = [ 1, 2, 3 ];obj = { a: 1, b: 2, c: 3 };alert(isArray(arr)); //truealert(isArray(obj)); //falsealert(isArray(num)); //falsealert(isArray(str)); //false