全局变量定义:

 1 /**
 2  *删除数组指定下标或指定对象
 3  */
 4 Array.prototype.remove=function(obj){
 5     for(var i =0;i <this.length;i++){
 6         var temp = this[i];
 7         if(!isNaN(obj)){
 8             temp=i;
 9         }
10         if(temp == obj){
11             for(var j = i;j <this.length;j++){
12                 this[j]=this[j+1];
13             }
14             this.length = this.length-1;
15         }
16     }
17 }
View Code

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-05
猜你喜欢
  • 2021-07-11
  • 2021-12-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案