head / !! / length
List access.
Syntax
head xs // xs !! i // length xs
Description
head returns the first element, xs !! i returns the i-th element (0-indexed). length returns the number of elements. Lists are printed without spaces: [1,2,3].
Example
Loading editor…
Expected output
10 20 3
When to use?
Accessing data collections.