I have a file (etc.js) with some function, one of this is indexOf Array:

if( typeof Array.prototype.indexOf==='undefined' ) {
Array.prototype.indexOf = function( v, b, s ) {
for( var i = +b || 0, l = this.length; i < l; i++ ) {
if( this[i]===v || s && this[i]==v ) { return i; }
}
return -1;
};
}

It is OK with FF. But with IE, when I created an empty array: arreglo[]. I got arreglo as an object with arreglo['indexOf'] = function declaration. I think this is given me a JS error in IE. Can any body help me?