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

Array Functions

repeat

Syntax

array.repeat(number int)

Makes an array with the given element number of times.

foo := [1, 2].repeat(5)
println(foo)

Output

[1, 2, 1, 2, 1, 2, 1, 2, 1, 2]

delete

Syntax

array.delete(ix int)

Deletes the element present in the array at index ix.

mut even_numbers := [2, 4, 6, 8, 10]
even_numbers.delete(3)
println(even_numbers)

Output

[2, 4, 6, 10]

reverse

Syntax

Reverses the array.

Output

clone

Syntax

Clones and returns a new array.

Output

Last updated

Was this helpful?