Arrays/slices
A slice/array is a sequence of elements. They are zero indexed, not a fixed size and can be modified on the fly.
Defining a new array
Appending elements to an array
Removing elements from an array
Accessing by index
Accessing last array index
Accessing a range of items
The range index syntax can be a powerful tool: [start:end]
The result will be a new array containing the given range of indexes from start to end.
Take the first 5 items of an array
Take the last 5 items of an array
Last updated