Tin

Examples · learn/08-collections · 143 of 339

sort

examples/learn/08-collections/sort.tintin run examples/learn/08-collections/sort.tin
fn main() {
  let scores = [72, 95, 88, 60]
  print(sort(scores))            // a sorted copy; scores itself is unchanged
  print(scores)
  print(sum(scores))
  print(first(scores))           // Option: an empty array has no first item
  print(join(["a", "b", "c"], " / "))
}