From: Dan Fitzpatrick Date: 2008-03-27T01:28:45+09:00 Subject: Re: Simple Question On Mar 26, 2008, at 10:19 AM, pete wrote: > Hi- > > This should be an easy one to answer... > > Is it possible to return an array from a function? > > Example (although a very bad one): > > def test(val1,val2) > myarr = Array.new > myarr = [val1,val2] > return myarr > end > > begin > thisarr = test(val1,val2) > end > Yes. Even shorter: def test(val1,val2) [val1,val2] end