From: Stefano Crocco Date: 2007-06-12T18:25:35+09:00 Subject: Re: add element at end of array Alle marted� 12 giugno 2007, Daniel Liebig ha scritto: > Hi there, > > i'm pretty new to Ruby. I searched 'Programming Ruby' and the online > documentation but couldn't find a solution. So please forgive me my > simple question ;). > > I just want to add a new value / object to an existing array. Right now > i'm using > > a[a.length] = 'foo' > > but i'm almost sure Ruby has a better way to do that!? > > Thx for any help > D. a << 'foo' or a.push 'foo' Stefano