/* Array, Object -> Void
359735
function traverseArray(arr, searchForObj) {
    const len = arr.length;

    for (let i = 0; i < len; i++) {
      const item = arr[i];

      if (isArray(item)) {
        traverseArray(item, searchForObj);
      } else if (isObject(item)) {
        traverseObject(item, searchForObj);
      }
    }
  }
1356966
function remove(array) {
  
  var args = Array.prototype.slice.call(arguments, 1);

  if(!isArray(array) || isEmpty(args)) {
    return array;
  }

  return array.filter(function(member) {
    return !args.some(function(nest) {
      return equals(nest, member);
    })
  });

}
1164989
public static void fill(final Object[] array, final Object value) {
        //        final int n = array.length;
        //        if (n > 0) {
        //            array[0] = value;
        //        }
        //        for (int i = 1; i < n; i += i) {
        //           System.arraycopy(array, 0, array, i, ((n - i) < i) ? (n - i) : i);
        //        }
        for (int i=0; i<array.length; i++) {
            array[i] = value;
        }        
    }
566756
function TaskQueue(array) {
  array = array || [];
  if (!Array.isArray(array)) throw new Error('TaskQueue parameter must be an array.');
  else {
    this.taskQueue = array;
    this.length = array.length;
    this.index = 0;
  }
}
442192
function(array) {
    var firstNode = array.length - 2;
    var nextNode = array.length - 1;
    var currentDepth, availableNodes, lastNode, i;

    for (currentDepth = 1, availableNodes = 2;
         availableNodes > 0;
         currentDepth++) {
      lastNode = firstNode;
      firstNode = first (array, lastNode - 1, 0);

      for (i = availableNodes - (lastNode - firstNode); i > 0; i--) {
        array[nextNode--] = currentDepth;
      }

      availableNodes = (lastNode - firstNode) << 1;
    }
  }
910399
protected void putBatch(Object[] objectArray) {

        int index = 0;
        synchronized (this) {
            while (index < objectArray.length && objectArray[index] != null) {
                put(objectArray[index]);
                index++;
            }
        }
        return;
    }
1198438
function Iterator(array) {

    // the array and current slot index are private attributes so methods that use them
    // are defined in the constructor
    var currentSlot = 0;  // the slot before the first item

    this.toStart = function() {
        currentSlot = 0;  // the slot before the first item
    };

    this.toSlot = function(slot) {
        const size = array.length;
        if (slot > size) slot = size;
        if (slot < -size) slot = -size;
        if (slot < 0) slot = slot + size + 1;
        currentSlot = slot;
    };

    this.toEnd = function() {
        currentSlot = array.length;  // the slot after the last item
    };

    this.hasPrevious = function() {
        return currentSlot > 0;
    };

    this.hasNext = function() {
        return currentSlot < array.length;
    };

    this.getPrevious = function() {
        if (!this.hasPrevious()) return;
        return array[--currentSlot];
    };

    this.getNext = function() {
        if (!this.hasNext()) return;
        return array[currentSlot++];
    };

    return this;
}
1189300
function(method, arr/*, arguments*/) {
    var args = [].slice.call(arguments, 2);
    utils.arrayify(arr || []).forEach(function (obj) {
      this[method](obj, args);
    }.bind(this));
    return this;
  }
713084
function ArrayDB( a ){

            var init = [], i, _l;

            if ( arguments.length === 1 && arguments[0] instanceof Array ) {

                init = a;

            } else if ( arguments.length >= 1 ) {

                init = arguments;

            }

            for ( i=0, _l=init.length; i<_l; i++ ) {

                this[ this.length++ ] = init[ i ];

            }

        }
1163238
public void addAll( T[] array , int first , int length ) {
		if( length <= 0 )
			return;

		Element<T> a = requestNew();
		a.object = array[first];

		if( this.first == null ) {
			this.first = a;
		} else if( last != null ) {
			last.next = a;
			a.previous = last;
		}

		for (int i = 1; i < length; i++) {
			Element<T> b = requestNew();
			b.object =  array[first+i];

			a.next = b;
			b.previous = a;
			a = b;
		}

		last = a;
		size += length;
	}
912537
function forEach(array, itemCallback) {
  for (let i = 0, len = array.length; i < len; i++) {
    if (itemCallback) {
      itemCallback.call(array[i], array[i], i);
    }
  }
}
1261394
function checkObject (obj) {
  if (util.isArray(obj)) {
    obj.forEach(function (o) {
      checkObject(o);
    });
  }

  if (typeof obj === 'object' && obj !== null) {
    Object.keys(obj).forEach(function (k) {
      checkKey(k, obj[k]);
      checkObject(obj[k]);
    });
  }
}
879714
function Iterator() {
    var items = Array.prototype.slice.call(arguments, 0);

    this.items = (items.length == 1 && Array.isArray(items[0])) ? items[0] : items;
    this.reset();
}
1116911
function array(obj, fn, ctx) {
  for (var i = 0; i < obj.length; ++i) {
    fn.call(ctx, obj[i], i);
  }
}
3554
private Iterator<Object> arrayIt(final Object array) {
        return new Iterator<Object>() {
            private int index = 0;
            private final int length = Array.getLength(array);
            @Override
            public boolean hasNext() {
                return this.index < this.length;
            }
            @Override
            public Object next() {
                try {
                    return Array.get(array, this.index++);
                } catch (Throwable t) {
                    throw new NoSuchElementException(t.getMessage());
                }
            }
        };
    }
1312757
function(index)
  {
    //Check the index value
    if(index >= keys.length)
    {
      //Do the callback and exit
      return cb(null);
    }
    else
    {
      //Get the key
      var key = (is_array) ? index : keys[index];

      //Get the value
      var value = list[key];

      //Call the provided method with the element of the array
      return fn.call(null, key, value, function(error)
      {
        //Check the error
        if(error)
        {
          //Do the callback with the provided error
          return cb(error);
        }
        else
        {
          //Continue with the next item on the list
          return each_async(index + 1);
        }
      });
    }
  }
1245934
function() {
    var result = [];

    for (var i = 0; i < this.length; i++) {
      var value = this[i];
      if (Array.isArray(value)) {
        for (var j = 0; j < value.length; j++) {
          result.push(value[j]);
        }
      } else {
        result.push(value);
      }
    }

    return result;
  }