.sortDesc()

Presentation

Sort array descending.

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.

sortDesc(callback?: (params: T) => any): Array<T>

That can be used to cast the params for the sort.

Example

[3, 1, 2].sortDesc() // [3, 2, 1]
[{ order: 3 }, { order: 1 }, { order: 2 }].sortDesc(a => a.order)
// [{ order: 3 }, { order: 2 }, { order: 1 }]

Last updated