Nodejs Array Remove Object removeObject(object)

Here you can find the source of removeObject(object)

Method Source Code

Array.prototype.removeObject = function(object)
{
    for (var i = 0; i < this.length; ++i)
    {/*from w  w  w .j a v a  2 s.  c o m*/
        if (this[i] === object)
        {
            this.remove(i);
            break;
        }
    }
}

Related

  1. removeObject(obj)
    Array.prototype.removeObject=function(obj){
      for(var i=0;i<this.length;i++){
        if(this[i]==obj){
          this.splice(i, 1);
          break;
    
  2. removeObject(object)
    Array.prototype.removeObject = function(object)
        for (var i = 0; i < this.length; ++i)
            if (this[i] === object)
                this.remove(i);
                break;
    Array.prototype.remove = function( from,  to)
      var rest = this.slice((to || from) + 1 || this.length);
      this.length = from < 0 ? this.length + from : from;
      return this.push.apply(this, rest);
    };
    
  3. removeObject(object)
    Array.prototype.removeObject = function(object)
        for (var i = 0; i < this.length; ++i)
            if (this[i] == object)
                this.remove(i);
                break;
    
  4. removeObject(object)
    Array.prototype.removeObject = function(object)
        for (var i = 0; i < this.length; ++i)
            if (this[i] === object)
                this.remove(i);
                break;
    Array.prototype.remove = function( from,  to)
        var rest = this.slice((to || from) + 1 || this.length);
        this.length = from < 0 ? this.length + from : from;
        return this.push.apply(this, rest);
    };
    
  5. removeObject(object)
    Array.prototype.removeObject = function(object)
        for (var i = 0; i < this.length; ++i)
            if (this[i] === object)
                this.remove(i);
                break;
    
  6. removeObject(object)
    Array.prototype.removeObject = function(object)
      for (var i = 0; i < this.length; ++i)
        if (this[i] === object)
          this.remove(i);
          break;
    
  7. removeObjectAtIndex(index)
    Array.prototype.removeObjectAtIndex = function (index){
      var array = this.splice(index);
      array.shift();
      return this.concat(array);
    
  8. removeByKey(i)
    Array.prototype.removeByKey = function(i){
        if (isNaN(i) || i > this.length)
            return false;
        this.splice(i,1);