Working with arrays is one of Ruby's strengths. They automatically resize, can contain any elements and the language provides powerful tools for their processing.
An array in Ruby is an instance of the Array class. ')
To create an empty array in Ruby, you can use one of the following two constructs:
a = [] b = Array.new
If you want to create an empty array of a certain size, you should specify its size as an argument to the new method.
myArray = Array.new (10)
You can also specify which classes objects will be stored in this array: