判断一个对象是否为数组
var arr=[];
var obj={};
console.log(Object.prototype.toString.call(arr) === '[object Array]');//true
console.log(Object.prototype.toString.call(obj) === '[object Array]');//false
console.log(arr instanceof Array);//true
console.log(obj instanceof Array);//false
console.log(Array.isArray(arr));//true
console.log(Array.isArray(obj));//false