List (list)

An array of elements. See arrays.

Returned by

List objects are returned by the following functions and methods:

List methods

list.contains()

Returns true if the array contains the object given as argument, false otherwise

Signature

# Returns `true` if the array contains the object
bool contains(
  any item,     # The item to check
)

Arguments

Argument flattening is NOT SUPPORTED by this function.

The method list.contains() accepts the following positional arguments:

Name Type Description Tags
item any

The item to check


list.get()

returns the object at the given index, negative indices count from the back of the array, indexing out of bounds returns the fallback value (since 0.38.0) or, if it is not specified, causes a fatal error

Signature

# returns the object at the given index,
any get(
  int index,        # Index of the list position to query
  any [fallback],   # Fallback value that is returned if the index is out of range
)

Arguments

Argument flattening is NOT SUPPORTED by this function.

The method list.get() accepts the following positional arguments:

Name Type Description Tags
index int

Index of the list position to query. Negative values start at the end of the list

fallback any

Fallback value that is returned if the index is out of range.

[optional]


list.length()

Returns the current size of the array / list.

Signature

int length()


The results of the search are