You can easily add two arrays in Ruby with plus
operator. So, just make an array out of your element.
arr = [1, 2]
puts arr + [3]
# => [1, 2, 3]
puts arr
# => [1, 2]
You can easily add two arrays in Ruby with plus
operator. So, just make an array out of your element.
arr = [1, 2]
puts arr + [3]
# => [1, 2, 3]
puts arr
# => [1, 2]