code: function compare(a, b) {
    var aMissing = isMissing(a);
    var bMissing = isMissing(b);
    if (aMissing && bMissing) {
      a = MISSING_ORDER[a];
      b = MISSING_ORDER[b];
    } else if (aMissing) {
      return -1;
    } else if (bMissing) {
      return 1;
    }
    return a < b ? -1 : a > b ? 1 : 0;
  }
docs: Comparison function for Array.prototype.sort(). This sorts number, boolean, string, or Date values via their natural ascending order, with any missing values showing up first. The intention is to impose a natural total ordering of all elements within a particular non-object dtype, including the dtype's missing value.  The result of compare(a, b) should be 0 if and only if a and b have equal values (e.g. deep equality for Dates). All bets are off comparing elements across different dtypes though.