Arrays
Creating Arrays
// Array literal
arr = [1, 2, 3]
// Range operator
arr = 1 to 5 // [1, 2, 3, 4, 5]
arr = -2 to 2 // [-2, -1, 0, 1, 2]
// Fill
arr = (1 to 3).fill("hi") // ["hi", "hi", "hi"]Concatenation
// Concatenate arrays with ++
arr = [1, 2] ++ [3, 4] // [1, 2, 3, 4]
// Prepend value to array
arr = "hello" + ["world"] // ["hello", "world"]
// Append value to array
arr = ["hello"] + "world" // ["hello", "world"]
// Concat method
arr = [1, 2, 3].concat([4, 5, 6]) // [1, 2, 3, 4, 5, 6]Accessing Elements
Searching
Modifying
Transforming
Aggregating
Random
Type Prototypes
Notes
Last updated