To create an array, you use the [] operator
array = [1, 2, 3]
# This creates an array with three elements, 1, 2, and 3.
# You access those elements using an array index like this:
puts array[0] #prints 1
puts array[1] #prints 2
puts array[2] #prints 3
Related examples in the same category