code: function mergeBy (getItemOrder, arrays) {
      var
        n = reduce(add, 0, map(getLength, arrays)),
        result = new Array(n),
        fingerArrays = map(mkFingerArray, arrays),
  
        i, min;
  
      for (i = 0; i < n; i++) {
        min = minBy(getItemOrder, fingerArrays);
  
        result[i] = getPointedFinger(min);
        min.pointer += 1;
      }
  
      return result;
    }
docs: In merge sort, two sorted array are combined to create a new sorted array with the contents of both. This is a generalization of 'merge' to n arrays and based on a computed function. O(n).