#map, provided by Enumerable, creates an array by invoking a block on each element and collecting the results:
[1, 2, 3].map { |i| i * 3 }
# => [3, 6, 9]
['1', '2', '3', '4', '5'].map { |i| i.to_i }
# => [1, 2, 3, 4, 5]
The original array is not modified; a new array is returned conta...