Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUBY

ruby array append vs push

# In Ruby 2.5, append and prepend are implemented as aliases to the original unshift and push methods.
a = ["hello"]
# => ["hello"]
a.append "world"
# => ["hello", "world"]
a.prepend "Hey"
# => ["Hey", "hello", "world"]
Source by www.bigbinary.com #
 
PREVIOUS NEXT
Tagged: #ruby #array #append #push
ADD COMMENT
Topic
Name
7+8 =