V
vasten
Hi:
I am a newbie as far as Ruby is concerned. I was going through the
programming ruby book (2nd Edition), but was not able to figure out the
difference between the 2 statements:
[1, 2, 3, 4].collect{ puts i }
and
[1, 2, 3, 4].each{|i| puts i }
Can some guru in this group shed some light?
Thanks.
I am a newbie as far as Ruby is concerned. I was going through the
programming ruby book (2nd Edition), but was not able to figure out the
difference between the 2 statements:
[1, 2, 3, 4].collect{ puts i }
and
[1, 2, 3, 4].each{|i| puts i }
Can some guru in this group shed some light?
Thanks.