Check out example codes for "ruby map array". It will help you in understanding the concepts better.
Code Example 1
array = ["a", "b", "c"]
array.map { |string| string.upcase }
# ["A", "B", "C"]
Code Example 2
hash = { bacon: "protein", apple: "fruit" }
hash.map { |k,v| [k, v.to_sym] }.to_h
# {:bacon=>:protein, :apple=>:fruit}
Learn ReactJs, React Native from akashmittal.com