function foreach(array, fn) {
  var I = jsLength(array);
  for (var i = 0; i < I; ++i) {
    fn(array[i], i);
  }
}
Iterates over the array, calling the given function for each
element.

@param {Array} array
@param {Function} fn