The difference between Enumerable#eachand Enumerable#mapis whether it returns a receiver or a matching result. Returning to the receiver is trivial, and you usually do not need to continue the method chain after eachhow each{...}.another_method(I probably haven’t seen such a case. Even if you want to return to the receiver, you can do this with tap). Therefore, I think that all or most of the cases when used Enumerable#eachcan be replaced by Enumerable#map. Am I mistaken? If I am right, what is the purpose each? Is mapslower than each?
Edit : I know that there is a common usage practice eachwhen you are not interested in the return value. I am not interested in whether such a practice exists, but I am interested in whether such a practice makes sense, except from the point of view of the convention.
source
share