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.

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
2015-03-30 21:23:38
Comments
Leave a Comment

Please login to continue.