unshift

ary.unshift(obj, ...) â ary
Instance Public methods

Prepends objects to the front of self, moving other elements upwards. See also #shift for the opposite effect.

1
2
3
a = [ "b", "c", "d" ]
a.unshift("a")   #=> ["a", "b", "c", "d"]
a.unshift(1, 2#=> [ 1, 2, "a", "b", "c", "d"]
doc_ruby_on_rails
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.