This blog is part of our Ruby 2.5 series.
prepend an element to the start of an array
Array#push to append an element to the end of an array.
The names of these methods are not very intuitive.
Active Support from Rails already has aliases for the unshift and push methods , namely
In Ruby 2.5, these methods are added in the Ruby language itself.
They are implemented as aliases to the original
push methods so there is no
change in the behavior.