<script language=JavaScript>
Array.prototype.addnew=function(v)
  {this[this.length]=v
  }
Array.prototype.delbyvalue=function(v)
  {for(i=0;i<this.length;i++)
     if(this[i]==v)
       for(j=i;j<this.length;j++)
         this[j]=this[j+1]
   this.length--
  }
Array.prototype.delbyindex=function(index)
  {for(i=index;i<this.length;i++)
     this[i]=this[i+1]
   this.length--
  }
var a=[1,2]
alert(a.join(";")+"长度"+a.length)
a.addnew(3)
alert(a.join(";")+"长度"+a.length)
a.delbyvalue(2)
alert(a.join(";")+"长度"+a.length)
a.addnew(2)
a.delbyindex(1)
alert(a.join(";")+"长度"+a.length)
</script>