Today I came across yet another way to add items to an array in ruby
I already knew about
<<, but did you know that there’s also an
[1,2,3].push(4) # => [1,2,3,4] [1,2,3] << 4 # => [1,2,3,4] [1,2,3].append(4) # => [1,2,3,4]
append is ultimately just an alias for
push, but always good to know!