Skip to content
On this page

compareDesc

ts
function compareDesc(a: number, b: number): number

Compare the strings in descending order.

Example

ts
['q', 'p', 'Q', 'P'].sort(str.compareDesc) // ['Q', 'P', 'q', 'p']