JS根據數組下表刪除元素

//新增根據數組下表remove元素方法
    Array.prototype.remove = function(obj){
        
        for(var i=0;i<this.length;i++){
            var temp = this[i];
            if(!isNaN(obj)){
                temp=i;
            }
            if(temp == obj){
                for(var j=i ;j<length;j++){
                    this[j] = this[J+1];
                }
                this.length = this.length-1 ;
            }
        }
    }
相關文章
相關標籤/搜索