Skip to main content

Comparison Utilities

Functions to compare values for sorting.

compare#

  • compare -- a set of predefined comparators for sorting: numbers, strings, classic (convert all to strings).
compare.numbers(4, 5); // -1compare.numbers(4, 4); // 0compare.numbers(5, 4); // +1