DrSchool Learn coding, fast.
EN AR BN CS DE EL Search

Sorting — Example 184

Quick explanation + ready code for: Sorting.

MQL5 Sorting Back to examples
Back to language
Syntax: Sorting in MQL5. ID: #184

Code

const a=[3,1,2,5];
a.sort((x,y)=>x-y);
console.log(a);

Notes

You can copy this snippet and adapt it. For advanced, add real-world inputs, edge cases, and tests.