enum.map { |obj| block } â array
enum.map â an_enumerator
enum.map â an_enumerator
Instance Public methods
Returns a new array with the results of running block once for every element in enum.
If no block is given, an enumerator is returned instead.
(1..4).collect { |i| i*i } #=> [1, 4, 9, 16] (1..4).collect { "cat" } #=> ["cat", "cat", "cat", "cat"]
Please login to continue.