The operation of the JS array is also encountered in ordinary projects, except for some increase or decrease in the operation, there is a more important operation is the addition of the array, through the addition of the array, we can be an array of multiple duplicate array to clean, leaving only the non-repeating. In addition to the following I introduce a primitive in the array of s in addition to the weight method.
array.prototype.check= function () {for (Var i=0;i<this.length;i++) {for (Var j=i+1;j<this.length;j++) {if (this[i ]==this[j]) {this.splice (i,1); i=i-1;}}} var temp=[1,2,3,3,4,5,5];temp.check (); Alert (temp)
By using the prototype of the array, we define the method check (), in this method by comparing two arrays, the same splice (), and then by defining an array, giving the method an array of operations, to get the results we need.
Native JS Array in addition to repeating