js/libs/ember-1.5.1.js
function (callback) {
    var items = [],
        offset = 0;

    forEach(this._operations, function (arrayOperation) {
      callback(arrayOperation.items, offset, arrayOperation.type);

      if (arrayOperation.type !== DELETE) {
        offset += arrayOperation.count;
        items = items.concat(arrayOperation.items);
      }
    });

    this._operations = [new ArrayOperation(RETAIN, items.length, items)];
  }
function (callback) {
    var items = [],
        offset = 0;

    forEach(this._operations, function (arrayOperation) {
      callback(arrayOperation.items, offset, arrayOperation.type);

      if (arrayOperation.type !== DELETE) {
        offset += arrayOperation.count;
        items = items.concat(arrayOperation.items);
      }
    });

    this._operations = [new ArrayOperation(RETAIN, items.length, items)];
  }
Apply all operations, reducing them to retain:n, for `n`, the number of
items in the array.

`callback` will be called for each operation and will be passed the following arguments:

{array} items The items for the given operation
{number} offset The computed offset of the items, ie the index in the
array of the first item for this operation.
{string} operation The type of the operation.  One of
`Ember.TrackedArray.{RETAIN, DELETE, INSERT}`

@method apply
@param {function} callback