Why does Enumerable#map
only support a block while Enumerable#inject
supports additional types, e.g. symbols?
I expected the following to work
["1", "2"].map(:to_i).inject(:+)
but only the following works
["1", "2"].map(&:to_i).inject(:+)
Nevertheless, using &
for both works too
["1", "2"].map(&:to_i).inject(&:+)
Which one is the best practice and why?