For the complete documentation index, see llms.txt. This page is also available as Markdown.

Array Operations

Appending Or Prepending To An Array With A Value

You can use the + operator to append or prepend a value to an array

log "hello" + ["world"]
// This prepends a value to an array, returning ["hello","world"]
// Note: The + operator does NOT add a space when used between a string and an array

log ["hello"] + "world"
// This appends a value to an array, returning ["hello","world"]
// Note: The + operator does NOT add a space when used between an array and a string

Removing A Value From An Array

You can use the - operator to remove a value at a numeric index from an array. The - operator does not support removing array elements by value (string comparison is not supported).

array_result = ["a", "b", "c"] - 1
// This removes the item at index 1 and returns ["a", "c"]

Concatenating Arrays

You can use the ++ operator to concatenate and join multiple arrays together

log ["hello"] ++ ["world"]
// This concatonated(joins) two arrays together and returns ["hello", "world"]

Range Operator (to)

The to operator creates an array containing sequential numbers from the first operand to the second operand (inclusive).

Last updated