2 ms·
I had no idea what you were trying to do in the first paragraph whereas without knowing much ruby I can easily read the intent of the second.
by XorNot 10y ago
I had no idea what you were trying to do in the first paragraph whereas without knowing much ruby I can easily read the intent of the second.
- sheepmullet 10y agoThat has more to do with familiarity than anything else. A tale of two cities is an easier book for an English speaker than Les Aventures de Tintin. Map applies a function to each item in a collection. As pseudo-code: Collection.map(function) And in the parents example we have: [1,2,3].map(&:to_s) The only Ruby specific part is &:.