bench/lib/benchmark.js
function each(object, callback, thisArg) {
    var result = object;
    object = Object(object);

    var fn = callback,
        index = -1,
        length = object.length,
        isSnapshot = !!(object.snapshotItem && (length = object.snapshotLength)),
        isSplittable = (noCharByIndex || noCharByOwnIndex) && isClassOf(object, 'String'),
        isConvertable = isSnapshot || isSplittable || 'item' in object,
        origObject = object;

    // in Opera < 10.5 `hasKey(object, 'length')` returns `false` for NodeLists
    if (length === length >>> 0) {
      if (isConvertable) {
        // the third argument of the callback is the original non-array object
        callback = function(value, index) {
          return fn.call(this, value, index, origObject);
        };
        // in IE < 9 strings don't support accessing characters by index
        if (isSplittable) {
          object = object.split('');
        } else {
          object = [];
          while (++index < length) {
            // in Safari 2 `index in object` is always `false` for NodeLists
            object[index] = isSnapshot ? result.snapshotItem(index) : result[index];
          }
        }
      }
      forEach(object, callback, thisArg);
    } else {
      forOwn(object, callback, thisArg);
    }
    return result;
  }
function each(object, callback, thisArg) {
    var result = object;
    object = Object(object);

    var fn = callback,
        index = -1,
        length = object.length,
        isSnapshot = !!(object.snapshotItem && (length = object.snapshotLength)),
        isSplittable = (noCharByIndex || noCharByOwnIndex) && isClassOf(object, 'String'),
        isConvertable = isSnapshot || isSplittable || 'item' in object,
        origObject = object;

    // in Opera < 10.5 `hasKey(object, 'length')` returns `false` for NodeLists
    if (length === length >>> 0) {
      if (isConvertable) {
        // the third argument of the callback is the original non-array object
        callback = function(value, index) {
          return fn.call(this, value, index, origObject);
        };
        // in IE < 9 strings don't support accessing characters by index
        if (isSplittable) {
          object = object.split('');
        } else {
          object = [];
          while (++index < length) {
            // in Safari 2 `index in object` is always `false` for NodeLists
            object[index] = isSnapshot ? result.snapshotItem(index) : result[index];
          }
        }
      }
      forEach(object, callback, thisArg);
    } else {
      forOwn(object, callback, thisArg);
    }
    return result;
  }
function each ( object , callback , thisArg ) { var result = object ; object = Object ( object ) ; var fn = callback , index = - 1 , length = object . length , isSnapshot = ! ! ( object . snapshotItem && ( length = object . snapshotLength ) ) , isSplittable = ( noCharByIndex || noCharByOwnIndex ) && isClassOf ( object , 'String' ) , isConvertable = isSnapshot || isSplittable || 'item' in object , origObject = object ; // in Opera < 10.5 `hasKey(object, 'length')` returns `false` for NodeLists if ( length === length >>> 0 ) { if ( isConvertable ) { // the third argument of the callback is the original non-array object callback = function ( value , index ) { return fn . call ( this , value , index , origObject ) ; } ; // in IE < 9 strings don't support accessing characters by index if ( isSplittable ) { object = object . split ( '' ) ; } else { object = [ ] ; while ( ++ index < length ) { // in Safari 2 `index in object` is always `false` for NodeLists object [ index ] = isSnapshot ? result . snapshotItem ( index ) : result [ index ] ; } } } forEach ( object , callback , thisArg ) ; } else { forOwn ( object , callback , thisArg ) ; } return result ; }
An iteration utility for arrays and objects.
Callbacks may terminate the loop by explicitly returning `false`.

@static
@memberOf Benchmark
@param {Array|Object} object The object to iterate over.
@param {Function} callback The function called per iteration.
@param {Mixed} thisArg The `this` binding for the callback.
@returns {Array|Object} Returns the object iterated over.
An iteration utility for arrays and objects . Callbacks may terminate the loop by explicitly returning false .