Just wonder. I have extended javascript Array object using its prototype as follows:
A question would be helpful ;-)
I assume you don't want the prototype property to show up? JS doesn't allow you to set "DontEnum" on properties you add to the prototype, so you have to check to see if the array has the property, or if it's a property of its prototype:
for(var i in ax) {
if (a.hasOwnProperty(i)) {
document.write(ax[i]);
}
}
although to iterate over an array you shouldn't really be using for...in
as that's for iterating over the properties of an object, rather than the elements of an array.