In Ruby the ‘<<' is known as the shovel operator. It is used to combine objects into a collection.

>> [1,2,3] << 4
=> [1,2,3,4]
 
>> "string" << "string"
=> "stringstring"
 
# But... watch out for Fixnums
>> 1234 << 1234
=> 365031051166393708260095154513671831030343173925050272423612359500511170882558832538140435164498513930071461334693559695511092989773691092996291580203825726057640844561157618576433726885920637564698606779411682823457283507197951818222683377496105470072442316349962893082659038154954129599847233366557298992327167360334539209445264003565411889202195958809353858085898007085056

:)

Leave a Reply

Your email address will not be published. Required fields are marked *