Iterates over each element of an array, calling the iterator with the
element and its index.

@param {!Array} collection
@param {function(*=,number)} iterator
15877
function each(collection, iterator) {
  for (var i = 0; i < collection.length; i++) {
    iterator(collection[i], i);
  }
}
1317320
public static int[] toIntArray(Collection<Integer> collection) {
        int[] collectionArray = new int[collection.size()];
        int index = 0;
        for (Integer item : collection) {
            collectionArray[index++] = item;
        }
        return collectionArray;
    }
1274251
public function map(array $collection, Closure $iterator)
    {
        foreach ($collection as $key => $node)
        {
            $collection[$key] = $iterator($key, $node);
        }

        return $collection;
    }
1258449
function iterator(obj, iteratee, memo, keys, index, length) {
                  for (; index >= 0 && index < length; index += dir) {
                    var currentKey = keys ? keys[index] : index;
                    memo = iteratee(memo, obj[currentKey], currentKey, obj);
                  }
                  return memo;
                }
1185388
function (property, callback) {
        // if only one arg we count the collection
        if ([].slice.call(arguments).length === 1) {
            callback = property 
            property = 'key'
        } 
        var c = 0 
        this.each(function(e){
            if (e[property]) c++
        })
        this.fn('count', callback).call(this, c)
    }
720417
@SuppressWarnings("unchecked")
  public static Object getElement(Object iterable, int index) {
    if (iterable.getClass().isArray())
      return getElementFromArrary(iterable, index);
    if (iterable instanceof Collection)
      return getElementFromCollection((Collection<Object>) iterable, index);

    return null;
  }
24615
function each(collection, fn, scope) {
  var i = 0,
    cont;

  for (i; i < collection.length; i++) {
    cont = fn.call(scope, collection[i], i);
    if (cont === false) {
      break; //allow early exit
    }
  }
}
261580
function each (iterable, fn) {
        var len
            , i = 0
            , iter
            , item
            , ret
        ;

        if (!iterable) throw genTypeError($invalidArgument);

        var gen = iterable[Symbol[$iterator]];
        if (isFunction(gen))
            iter = gen.call(iterable);
        else if (isFunction(iterable.next)) {
            iter = iterable;
        }
        else if (isInstanceOf(iterable, Arr)) {
            len = iterable.length;
            while (i < len) {
                fn(iterable[i], i++);
            }
            return i;
        } else
            throw genTypeError($invalidArgument);

        while (!(item = iter.next()).done) {
            ret = genTryCatcher(fn)(item.value, i++);
            if (ret === $tryErr) {
                isFunction(iter[$return]) && iter[$return]();
                throw ret.e;
            }
        }

        return i;
    }
911090
@SuppressWarnings("unchecked")
  public static Iterator<Object> iterator(Object iterable) {
    Assert.state(isIterable(iterable.getClass()));
    return iterable.getClass().isArray() ? new ArrayIterator(iterable)
        : ((Iterable<Object>) iterable).iterator();
  }
324449
function each(collection, callback, scope) {
		if ("[object Object]" === Object.prototype.toString.call(collection)) {
			for (var d in collection) {
				if (Object.prototype.hasOwnProperty.call(collection, d)) {
					callback.call(scope, d, collection[d]);
				}
			}
		} else {
			for (var e = 0, f = collection.length; e < f; e++) {
				callback.call(scope, e, collection[e]);
			}
		}
	}
750982
function(items, iterator, done) {
    done = done || function() {};
    var results = [];
    var failure = false;
    var expected = items.length;
    var current = -1;

    function callback(err, result) {
      if (err) return done(err);

      results.push(result);

      if (current == expected) {
        return done(null, results);
      } else {
        next();
      }
    }

    function next() {
      current += 1;

      var item = items[current];
      iterator(item, callback);
    }

    next()
  }
1330144
function iterateArray(array) {
  return ArrayCompiler.compileArray(array.map(function(obj) {
    return iterate(obj);
  }), data);
}
926613
public static Object getElementFromCollection(Collection<Object> collection, int index) {
    if (collection.size() < index + 1)
      return null;

    if (collection instanceof List)
      return ((List<Object>) collection).get(index);

    Iterator<Object> iterator = collection.iterator();
    for (int i = 0; i < index; i++) {
      iterator.next();
    }
    return iterator.next();
  }
250317
function(collection) {
        return Array.from ? Array.from(collection) : Array.apply(null, collection);
      }
47877
function(collection, cb) {
    _iterate(collection, cb, function(val, key) {
      cb(val, key);
    });
  }
55584
function Iterator(tree, snapshot) {
  this.tree = tree;
  this.root = snapshot;
  this.current = snapshot;
  this.key = null;
  this.value = null;
}
179875
function each(collection, callback) {
        if (utils.isNode(collection) || collection === window || collection === document) {
            collection = [collection];
        }
        if (!utils.isArrayLike(collection) && !utils.isObject(collection)) {
            collection = [collection];
        }
        if (utils.size(collection) == 0) {
            return;
        }

        if (utils.isArrayLike(collection) && !utils.isObject(collection)) {
            var l = collection.length,
                i = 0;
            for (; i < l; i++) {
                if (callback.call(collection[i], collection[i], i, collection) === false) {
                    break;
                }
            }
        } else if (utils.isObject(collection)) {
            for (var key in collection) {
                if (utils.has(collection, key)) {
                    if (callback.call(collection[key], collection[key], key, collection) === false) {
                        break;
                    }
                }
            }
        }
    }