how remove the last item of an array in ruby code example
Example 1: ruby pop array
a = [1, 2, 3, 4]
a.pop()
# => 4
Example 2: delete item from array in ruby
a = [3, 2, 4, 6, 3, 8]
a.delete(3)
a = [1, 2, 3, 4]
a.pop()
# => 4
a = [3, 2, 4, 6, 3, 8]
a.delete(3)