Skip to main content

compare

functionv1.0

clojure.core/compare

Available in:BBCLJCLJS
(compare [x y])
Comparator. Returns a negative number, zero, or a positive number when x is logically 'less than', 'equal to', or 'greater than' y. Same as Java x.compareTo(y) except it also works for nil, and compares numbers and collections in a type-independent manner. x must implement Comparable

No examples yet. Be the first to add one!

See Also