Returns a comparator that puts null and undefined after every other value, treats them as
equal to each other, and orders the rest with comparator (natural order when omitted).
comparator is never called with null or undefined.
Time: O(1) plus at most one call of comparator per comparison.
Returns a comparator that puts
nullandundefinedafter every other value, treats them as equal to each other, and orders the rest withcomparator(natural order when omitted).comparatoris never called withnullorundefined.Time: O(1) plus at most one call of
comparatorper comparison.