Array.prototype.del = function(value) {//删除数组中指定的元素,返回新数组function hasValue(array, value) {for(var i = 0; i < array.length; i++) {if (value == array[i]) {return i;}}return -1;}var position = hasValue(this, value);var temp = new Array ;if(position != -1) {temp = this.slice(0, position).concat(this.slice(position+1, this.length));return temp;}return this; }