Docs Menu

Welcome

Arrays

Arrays are defined using square brackets [] and hold ordered collections of values. They are dynamic and can hold elements of different types.

drylang
arr = [10, "hello", 30]
pt(arr[1]) // "hello"

Array Destructuring

You can extract elements from an array using destructuring:

drylang
arr = [10, 20, 30]
[a, b, c] = arr
pt(a) // 10
pt(b) // 20