Skip to content
ExamplesOpen editor ↗

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.

NameTypeDescription
lenaanelenaaneThe array to operate on.
papiso (optional)tiroOptional comparator receiving two values.
Sorts an array in place
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();
}

balaLenaane, kopololaKarolo