.sortAsc()
This method is implemented in Array.prototype
Presentation
Sort array ascending.
Usage
Params
callback
An optional argument that can be used to specify the value to sorted.
The callback receives from params the current interaction value.
sortAsc(callback?: (params: T) => any): Array<T>
Example
[3, 1, 2].sortAsc() // [1, 2, 3]
[{ order: 3 }, { order: 1 }, { order: 2 }].sortAsc(a => a.order)
// [{ order: 1 }, { order: 2 }, { order: 3 }]
Last updated