function defaultComparer(a, b) {
      var result = 0;
      var criteriaName;
      var criteriaOrder;
      var valA;
      var valB;

      // Loop through the list of sort criteria.
      for (var i = 0; i < sortComparer.length; i++) {
        // Get the criteria name, which should match an item's sort data key.
        criteriaName = sortComparer[i][0];
        criteriaOrder = sortComparer[i][1];

        // Get items' cached sort values for the criteria. If the item has no sort
        // data let's update the items sort data (this is a lazy load mechanism).
        valA = (a._sortData ? a : a._refreshSortData())._sortData[criteriaName];
        valB = (b._sortData ? b : b._refreshSortData())._sortData[criteriaName];

        // Sort the items in descending order if defined so explicitly. Otherwise
        // sort items in ascending order.
        if (criteriaOrder === 'desc' || (!criteriaOrder && isDescending)) {
          result = valB < valA ? -1 : valB > valA ? 1 : 0;
        } else {
          result = valA < valB ? -1 : valA > valB ? 1 : 0;
        }

        // If we have -1 or 1 as the return value, let's return it immediately.
        if (result) return result;
      }

      // If values are equal let's compare the item indices to make sure we
      // have a stable sort. Note that this is not necessary in evergreen browsers
      // because Array.sort() is nowadays stable. However, in order to guarantee
      // same results in older browsers we need this.
      if (!result) {
        if (!indexMap) indexMap = createIndexMap(origItems);
        result = isDescending ? compareIndexMap(indexMap, b, a) : compareIndexMap(indexMap, a, b);
      }
      return result;
    }
Sort items. There are three ways to sort the items. The first is simply by
providing a function as the comparer which works identically to native
array sort. Alternatively you can sort by the sort data you have provided
in the instance's options. Just provide the sort data key(s) as a string
(separated by space) and the items will be sorted based on the provided
sort data keys. Lastly you have the opportunity to provide a presorted
array of items which will be used to sync the internal items array in the
same order.

@public
@param {(Function|String|Item[])} comparer
@param {Object} [options]
@param {Boolean} [options.descending=false]
@param {(Boolean|Function|String)} [options.layout=true]
@returns {Grid}