typeof 只能判断5中基本类型:
var obj = {};
console.log(" obj === 'object' : ", typeof obj === 'object');
执行结果:

var obj = [];
console.log(" obj === 'object' : ", typeof obj === 'object');
执行结果:

var obj = null;
console.log(" obj === 'object' : ", typeof obj === 'object');
执行结果:

ES3中 Object.prototype.toString方法可以检测对象类型:Object.prototype.toString.call(var)。
var obj = {};
console.log(" obj is object : ", Object.prototype.toString.call(obj) === '[object Object]');
执行结果:

var obj = null;
console.log(" obj is object : ", Object.prototype.toString.call(obj) === '[object Object]');
执行结果:

var obj = [];
console.log(" obj is object : ", Object.prototype.toString.call(obj) === '[object Object]');
执行结果:
