Compare two strings with a reverse-alphabetic ordering.
To sort strings with numbers in a human-friendly way, see compareStringsNaturalReversed. The empty values "", null, and undefined sort last.
compareStringsNaturalReversed
""
null
undefined
the first string to compare
the second string to compare
reverse-alphabetic ordering
Sort strings alphabetically in reverse order.
import { compareStringsReversed } from "@trashpanda001/helpers/comparators"compareStringsReversed("z", "y")// -1 .. z, ycompareStringsReversed("a", "b")// 1 ... b, a Copy
import { compareStringsReversed } from "@trashpanda001/helpers/comparators"compareStringsReversed("z", "y")// -1 .. z, ycompareStringsReversed("a", "b")// 1 ... b, a
Compare two strings with a reverse-alphabetic ordering.
To sort strings with numbers in a human-friendly way, see
compareStringsNaturalReversed
. The empty values""
,null
, andundefined
sort last.