Skip to content
On this page

compareAsc

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

Compare the strings in ascending order.

Example

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