array string ruby

  1. Create an array with strings in Ruby:
array = ["apple", "banana", "cherry", "date"]
  1. Access an element in the array:
puts array[1]
  1. Add an element to the end of the array:
array << "fig"
  1. Remove the last element from the array:
array.pop
  1. Iterate over the array using each:
array.each do |fruit|
  puts fruit
end