Array.prototype.contains = function (elem) {   
 for (var i = 0; i < this.length; i++) {       
      if (this[i] == elem) {              
       return true;           
     }      
   }     
  return false; 
 }

 
Array.prototype.indexOf = function(o){   

    for(var i = 0 ;  i<this.length;i++){

           if(this[i] == o){

                            return i;

           }           return -1;     } };

 

 

Array.prototype.delete = function(o){

   var index = this.indexOf(o);

           if(index != -1){

                 this.splice(index,1)

             }

           return this;

}

 

相关文章:

  • 2021-06-05
  • 2022-12-23
  • 2021-06-05
  • 2022-12-23
  • 2022-12-23
  • 2021-11-13
  • 2022-12-23
猜你喜欢
  • 2021-05-18
  • 2022-12-23
  • 2021-06-15
  • 2021-07-04
  • 2021-07-09
  • 2022-12-23
  • 2021-06-25
相关资源
相似解决方案