arraySort

arraySort

> Fonctions

Sorts the elements from given array according to callback function. Elements are compared by pairs, each one being an input of the callback function.

The callback function needs to return a negative value, 0 or a positive value, respectively if the first input element is before, at the same place or after the second input element.

The callback function takes 1 to 3 arguments in this order: value, key, array.

Paramètres
Retour
Example