tlhaolaLenaane
Sorts an array in place.
tlhaolaLenaane(lenaane, [papiso])Mutates and returns the same array. The optional comparator returns a negative number, zero or a positive number for before, equal or after. Without a comparator, values sort as strings, not numerically. Use tiro(a, b) { busa a - b; } for ascending numbers.
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
lenaane | lenaane | The array to operate on. |
papiso (optional) | tiro | Optional comparator receiving two values. |
Examples
Section titled “Examples”tiro setaLoeto() {
thalaKanefase(320, 220);
bokamorago(235);
diri a = [20, 3, 11];
tlhaolaLenaane(a, tiro(x, y) { busa x - y; });
bogoloJwaMokwalo(32);
thalaMokwalo(mokwalo(a), 60, 120);
emisaPoapoeletso();
}