var is_array = function(value){
return value && typeof value==='object' && value.constructor===Array;
};
缺点:识别从不同的窗口(window)或帧(frame)里构造的数组时会失败。更好的方法:
var is_array = function(value){
return Object.prototype.toString.apply(value) === '[object Array]';
};