ee.List.sort
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Sortiert die Liste in aufsteigender Reihenfolge. Wenn das Argument „keys“ angegeben wird, wird es zuerst sortiert und die Elemente von „list“ werden in derselben Reihenfolge platziert.
Nutzung | Ausgabe |
---|
List.sort(keys) | Liste |
Argument | Typ | Details |
---|
So gehts: list | Liste | Die Liste, die sortiert werden soll. |
keys | Liste, Standard: null | Optionale Schlüssel, nach denen sortiert werden soll. Wenn „keys“ angegeben wird, muss es dieselbe Länge wie „list“ haben. |
Sofern nicht anders angegeben, sind die Inhalte dieser Seite unter der Creative Commons Attribution 4.0 License und Codebeispiele unter der Apache 2.0 License lizenziert. Weitere Informationen finden Sie in den Websiterichtlinien von Google Developers. Java ist eine eingetragene Marke von Oracle und/oder seinen Partnern.
Zuletzt aktualisiert: 2025-07-26 (UTC).
[null,null,["Zuletzt aktualisiert: 2025-07-26 (UTC)."],[[["\u003cp\u003e\u003ccode\u003eList.sort()\u003c/code\u003e arranges the elements of a list in ascending order, modifying the original list directly.\u003c/p\u003e\n"],["\u003cp\u003eAn optional \u003ccode\u003ekeys\u003c/code\u003e argument can be provided to specify the order in which elements should be sorted, requiring \u003ccode\u003ekeys\u003c/code\u003e to be the same length as the list being sorted.\u003c/p\u003e\n"]]],["The function `List.sort()` sorts a list in ascending order. It optionally accepts a `keys` argument, a list of the same length, to dictate the sort order. If `keys` is provided, the original `list` is reordered to match the sorted `keys`. The function returns the sorted `list`. If `keys` are not provided it sorts the list itself, by its values, in ascending order.\n"],null,["# ee.List.sort\n\nSorts the list into ascending order. If the 'keys' argument is provided, then it is sorted first, and the elements of 'list' are placed in the same order.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|-----------------------|---------|\n| List.sort`(`*keys*`)` | List |\n\n| Argument | Type | Details |\n|--------------|---------------------|------------------------------------------------------------------------------------------|\n| this: `list` | List | The list to sort. |\n| `keys` | List, default: null | Optional keys to sort by. If 'keys' is provided, it must have the same length as 'list'. |"]]