i have a problem. I have written a code for extend Array Element, and works fine, but when i iterate over array this show extended functions. I don't know how stop this. There is the code...
Array.prototype.remove = function(e) {var i = this.inArray(e);if(i != -1) this.splice(i, 1);return this;};
Array.prototype.add = function(e) {this.push(e); return e;};
Array.prototype.inArray = function(v) {for(i in this) if(v==this[i])return i;return false;};
Array.prototype.toggle = function(v) {this.inArray(v) ? this.remove(v) : this.add(v);return this;};
So when i tried this...
var arr = [1,2,3,4,5];
for(i in arr)
document.write(arr[i]);
this print array values and functions extended. somebody can help me? I can't change the code "for(x in y)" because is many times in many files.