Return to Snippet

Revision: 24770
at March 10, 2010 18:46 by inkdeep


Initial Code
# returns: ["0: a", "1: b", "2: c"]
%w(a b c).enum_for(:each_with_index).collect { |o, i| "#{i}: #{o}" }

Initial URL

                                

Initial Description

                                

Initial Title
Ruby array collect with index

Initial Tags
array, ruby

Initial Language
Ruby