判断是否为数组
1 var is_array =
function(value) {
2 return value &&
typeof value === 'object' &&
typeof value.length === 'number' &&
typeof value.splice === 'function' && !(value.propertyIsEnumerable('length'
));
3 };
4
5 //使用方法
6 var arrayValue =
[];
7 console.log(is_array(arrayValue));
转载于:https://www.cnblogs.com/qzsonline/archive/2012/07/15/2592437.html