function box(arr){this.arr=arr;} box.prototype.aa=function(){ this.ori = [].concat(this.arr); for (var i=0;i<this.arr.length;i++) { for (var j=i+1;j<this.arr.length;j++ ) { if (this.arr[i]==this.arr[j]) { this.arr.splice(j,1); } } } alert(原来的是:+this.ori+\n+去重后:+this.arr); } var num=new box([1,5,10,8,20,7,4,2,4,5,3,1,19,20]); num.aa();
1500字范文,内容丰富有趣,写作好帮手!