ee.Array.sort
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
จัดเรียงองค์ประกอบของอาร์เรย์ตามแกนใดแกนหนึ่ง
การใช้งาน | การคืนสินค้า |
---|
Array.sort(keys) | อาร์เรย์ |
อาร์กิวเมนต์ | ประเภท | รายละเอียด |
---|
ดังนี้ array | อาร์เรย์ | อาร์เรย์รูปภาพที่จะจัดเรียง |
keys | อาร์เรย์ ค่าเริ่มต้น: null | คีย์ที่ไม่บังคับในการจัดเรียง หากไม่ได้ระบุ ระบบจะใช้ค่าเป็นคีย์ คีย์จะมีองค์ประกอบหลายรายการได้ในแกนเดียวเท่านั้น ซึ่งจะเป็นตัวกำหนดทิศทางที่จะจัดเรียง |
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
[null,null,["อัปเดตล่าสุด 2025-07-26 UTC"],[[["\u003cp\u003eThe \u003ccode\u003esort\u003c/code\u003e method arranges elements within an array along a single axis.\u003c/p\u003e\n"],["\u003cp\u003eBy default, \u003ccode\u003esort\u003c/code\u003e uses the array values for sorting; however, optional \u003ccode\u003ekeys\u003c/code\u003e can be specified for customized sorting based on another array with matching dimensions.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ekeys\u003c/code\u003e array must have multiple elements along only one axis to determine the sort direction.\u003c/p\u003e\n"],["\u003cp\u003eThe modified array, with elements sorted according to the specified logic, is returned by the \u003ccode\u003esort\u003c/code\u003e method.\u003c/p\u003e\n"]]],[],null,["# ee.Array.sort\n\nSorts elements of the array along one axis.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|------------------------|---------|\n| Array.sort`(`*keys*`)` | Array |\n\n| Argument | Type | Details |\n|---------------|----------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| this: `array` | Array | Array image to sort. |\n| `keys` | Array, default: null | Optional keys to sort by. If not provided, the values are used as the keys. The keys can only have multiple elements along one axis, which determines the direction to sort in. |"]]