uhm... non mi sembra che sia di sola lettura... hai per caso visto le estensioni Array di wedev?
codice:
if(!Array.prototype.pop) {
Array.prototype.pop = function() {
var l=this.length,r=this[l-1];
this.length = l-1;
return r;
}
}
if(!Array.prototype.push) {
Array.prototype.push = function(v) {
this[this.length]=v;
}
}
if(!Array.prototype.slice) {
Array.prototype.slice = function(i,f) {
var j,l=this.length,r=[];
f=!f||Math.abs(f)>=l?Math.sign(f||1)*l:(l+f)%l;
for(j=i;j<f;j++) {
r[r.length]=this[j];
}
return r;
}
}
if(!Array.prototype.splice) {
Array.prototype.splice = function(s,n) {
var i,j,k,l=this.length,ar=arguments,r,ap=[];
n=n<0?0:s+n>l?l-s:n;r=this.slice(s,s+n);
for(i=s+n;i<l;i++) {
ap[i-s-n]=this[i];
} //mi salvo i contenuti da s+n in poi
for(j=s,k=2;k<ar.length;k++) {
this[j++]=ar[k];
} // sostituisco da s gli n elementi
for(j=s+k-2,i=0;i<ap.length;i++) {
this[j++]=ap[i];
}
this.length=j;
return r;
}
}
// rimuove un indice da un array
Array.prototype.remove = function(index) {
for(i=0,j=0;i<this.length;i++)
if(i!=index)
this[j++]=this[i];
this.length=j;
return this;
}
// rimuove un indice da un array
// potrebbe anche essere sfruttato l'else dell'if per gestire le eccezioni
Array.prototype.remove_s = function(index) {
for(var i=index,l=this.length;i<l;i++) {
this[i]=this[i+1]
}
if(index<l) {
delete this[l-1];
this.length=l-1;
}
return this;
}