function isArray(obj) { return Object.prototype.toString.call(obj) == '[object Array]'; } Object.prototype.toString = function() {return ''}; var a = []; alert(isArray(a));