how to remove the first element in an array ruby

# Given array
my_array = [1, 2, 3, 4, 5]

# Remove the first element from the array
my_array.shift
  1. my_array: Declares an array named my_array with elements [1, 2, 3, 4, 5].
  2. my_array.shift: Removes the first element from the array. The shift method is used to remove and return the first element of an array, causing the remaining elements to be shifted left. After this operation, my_array will be [2, 3, 4, 5].