Array.new creates an empty array, represented as [], named months. : Array Creation « Array « Ruby
- Ruby
- Array
- Array Creation
Array.new creates an empty array, represented as [], named months.
# test whether an array is empty or not with the empty? method
months = Array.new
months.empty? # => true
Related examples in the same category