code: function variadicComparator(comparator) {
      return function() {
        var result;
        for (var i = 0; i < arguments.length - 1; i++) {
          result = comparator(arguments[i], arguments[i + 1]);
          if (result === false) return result;
        }
        return result; 
      };
    }
docs: Turn a binary comparator into a variadic comparator