Skip to content
On this page

compareAsc

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

Compare the numbers in ascending order.

Example

ts
[1, 9, 2, 8, 3, 7, 4].sort(num.compareAsc) // [1, 2, 3, 4, 7, 8, 9]