Combine keys and values in RUBY -


given hash:

{:a => "123", :b => "345", :c => "678", :d => "910"} 

write code generates array combines keys , values. resulting array should be:

["a123", "b345", "c678", "d910"] 

i this:

{:a => "123", :b => "345", :c => "678", :d => "910"}.map { |k, v| "#{k}#{v}" } #=> ["a123", "b345", "c678", "d910"] 

Comments

Popular posts from this blog

android - Pass an Serializable object in AIDL -

php - Improving script execution time -

How to provide Authorization & Authentication using Asp.net, C#? -