returns next item.
@param {Array} array
503714
function (array, item) {
      var idx = indexOf(array, item);
      if (idx === -1) { return null; }

      return array[idx + 1];
    }
1036282
private int findIndex(Object key, Object[] array) {
        int length = array.length;
        int index = getModuloHash(key, length);
        int last = (index + length - 1) % length;
        while (index != last) {
            if (array[index] == key || array[index] == null) {
                /*
                 * Found the key, or the next empty spot (which means key is not
                 * in the table)
                 */
                break;
            }
            index = (index + 1) % length;
        }
        return index;
    }
155181
function _next (res) {
      if (res && !options.skipParse) {
        res = [].concat(res)
      }

      return next(res || result, cb)
    }
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;
}
218842
function arraySearch(items, id) {
  for (var i = 0; i < items.length; i++)
    if (items[i].id === id) {
      return items[i];
    }
}
813558
function getItemsFromList(list, itemsToGet) {
    var result = [];

    _.each(list, function (item) {
        for (var i = 0; i < itemsToGet.length; i++) {
            if (item.indexOf(itemsToGet[i]) === 0) {
                result.push(item);
            }
        }
    });

    return result;
}
800596
function(a) {
		if (!Array.isArray(a)) { return []; }

		return a.filter(function(item, index) {
			// Is this the first location of item
			return a.indexOf(item) === index;
		});
	}
460510
function(array) {
    let sorted = array.sort((a, b) => {
      return a.id - b.id;
    });
    let i = sorted.length - 1;
    while (i--)
      if (sorted[i + 1].id === sorted[i].id)
        sorted.splice(i,1);

    return sorted;
  }
693047
function findSameInArray (array, compareIndex) {
  const sliders = [];

  array.forEach((value, index) => {
    if (value === array[compareIndex]) {
      sliders.push(index);
    }
  });

  return sliders;
}
1247269
static function fetchRepeatMemberInArray( $array )
	{
		$arrRepeat = [];
		$length = count( $array );
		for ( $i = 0; $i < $length; $i++ ) { 
			for ( $j = $i + 1; $j < $length; $j++ ) { 
				if ( $array[$i] == $array[$j] ) {
					$arrRepeat[] = $array[$i];
				}
			}
		}

		return $arrRepeat;
	}
939401
function(array) {
            var ln = array.length,
                newAry = [];
            for (var i = 0; i < ln; i++) {
                if (jsonQ.index(newAry, array[i]) == -1) {
                    newAry.push(array[i]);
                }
            }
            return newAry;
        }
514501
def next(self):
        """"""
        rv = self.current
        self.pos = (self.pos + 1) % len(self.items)
        return rv
836802
@Override
	public Endpoint next(Endpoint[] array) {

		// Minimum values
		long minResponseTime = Long.MAX_VALUE;
		Endpoint minEndpoint = null;

		// Processing variables
		Endpoint endpoint;
		long responseTime;

		// Find the lower response time
		for (int i = 0; i < maxTries; i++) {

			// Get random endpoint
			endpoint = super.next(array);

			// Check response time
			responseTime = factory.getAverageResponseTime(endpoint.getNodeID());
			if (minEndpoint == null || responseTime < minResponseTime) {
				minResponseTime = responseTime;
				minEndpoint = endpoint;
			}
		}
		return minEndpoint;
	}
198452
@Override
	public Endpoint next(Endpoint[] array) {
		return array[(int) (System.nanoTime() % array.length)];
	}
1304522
def next(self):
        """"""
        item = six.next(self._item_iter)
        result = self._item_to_value(self._parent, item)
        # Since we've successfully got the next value from the
        # iterator, we update the number of remaining.
        self._remaining -= 1
        return result
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());
                }
            }
        };
    }
425395
@Override
	public Endpoint next(Endpoint[] array) {
		return array[rnd.nextInt(array.length)];
	}