T
thufir
# example program to illustrate inject num_ary = [10,37,27,398,273,28]
# summing without inject:
without_inject_sum = 0
num_ary.each{|num| without_inject_sum += num}
# summing with inject
with_inject_sum = num_ary.inject{|sum, num| sum + num}
Thank you for the example. I'm not convinced that inject is fantastic,
but certainly it's something I need to understand and this example helps
to illuminates it.
-Thufir