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 &:.
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 &:.