List
Overview
The List object is the primary container for a dynamically-sized sequence of values. Lists are also implicitly
iterable and can be used directly with for-in loop statements.
Fields
.map
fn [V = Any](callback: fn (T?, Number?) -> V) -> List[V]Mutates each element in a List with a given transformation callback.
.fold
fn [V = Any](initial: V, callback: fn (V, T) -> V) -> VReduces all elements in a List to an accumulated value.
.erase
fn (start?: Number, end?: Number) -> List[T]Removes elements from a List indicated by a given range.
.slice
fn (start?: Number, end?: Number) -> List[T]Creates a section of a List indicated by a given range.
.first_index_of
fn (needle: T) -> NumberFinds the index of the first element in a List that matches a given needle.
.last_index_of
fn (needle: T) -> NumberFinds the index of the last element in a List that matches a given needle.