ee.List.sort
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
इस विकल्प से, सूची को बढ़ते क्रम में लगाया जाता है. अगर 'keys' आर्ग्युमेंट दिया जाता है, तो इसे सबसे पहले क्रम से लगाया जाता है. इसके बाद, 'list' के एलिमेंट को उसी क्रम में रखा जाता है.
इस्तेमाल | रिटर्न |
---|
List.sort(keys) | सूची |
आर्ग्यूमेंट | टाइप | विवरण |
---|
यह: list | सूची | वह सूची जिसे क्रम से लगाना है. |
keys | सूची, डिफ़ॉल्ट: null | क्रम से लगाने के लिए वैकल्पिक कुंजियां. अगर 'keys' दिया गया है, तो इसकी लंबाई 'list' की लंबाई के बराबर होनी चाहिए. |
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-07-26 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 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'. |"]]