List
Immutable ordered collection.
Syntax
List(1,2,3) // l(0) l.length l :+ x
Description
List is immutable; indexing starts at 0, access is with l(0) (parentheses). :+ adds a new element and returns a NEW list. length is the number of elements.
Example
Loading editor…
This language is for reference/learning only — copy the code and try it in your own environment.
Expected output
List(1, 2, 3) 1 3
When to use?
Functional data processing (map/filter/fold).