> Functions
Sorts the array array in ascending or descending order. The default ascending order is:
null elementsIn LS1, the ascending order is: numbers, booleans, arrays, null elements, then strings.
SORT_ASC to sort array in ascending order, or SORT_DESC to sort it in descending order.In JavaScript, a.sort() without a comparator sorts the elements as strings: [10, 9, 1] becomes [1, 10, 9], not the numeric order of sort in LeekScript. Always pass a comparator for numbers, a.sort((x, y) => x - y), and (x, y) => y - x for the descending order of SORT_DESC. The sort happens in place and returns the array itself; a.toSorted(...) returns a sorted copy.
In Python, a.sort() sorts the list in place and returns None, like sort in LeekScript: do not write a = a.sort(), or you will lose the list. There is no order constant — a.sort(reverse=True) replaces SORT_DESC, a.sort(key=...) sorts by a key, and random.shuffle(a) replaces shuffle(a). Sorting compares the elements with each other: a list mixing numbers and strings raises a TypeError.
Impossible de charger les données du jeu.
Vérifiez votre connexion et réessayez.