Skip to content
← Index | Lesson 1 of 5

Arrays

Arrays in Zolo

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.

lesson-4-1.zolo
Program output

Run the code to see the output

Search Zolo

9 results

enespt-br