Arrays are 0-indexed (like C/JavaScript):
let nums = [1, 2, 3, 4, 5] print(nums[0]) // 1 print(Array.len(nums)) // 5 let doubled = nums |> Array.map(|x| x * 2) let filtered = nums |> Array.filter(|x| x > 2)
Goal: Create an array with [10, 3, 7, 1, 9], sort it and print the smallest and largest element.
Run the code to see the output
9 results