<<(p1) public

Append—Pushes the given object on to the end of this array. This expression returns the array itself, so several appends may be chained together.

a = [ 1, 2 ]
a << "c" << "d" << [ 3, 4 ]
        #=>  [ 1, 2, "c", "d", [ 3, 4 ] ]
a
        #=>  [ 1, 2, "c", "d", [ 3, 4 ] ]
Show source
Register or log in to add new notes.