DEV Community

Discussion on: Level Up Your Ruby Skillz: Working With Arrays

Collapse
 
danazar96 profile image
Aidan Walters-Williams • Edited

Fantastic article Molly! I have been using

result = [1, 2, 3].map do |number|
  ['a', 'b', 'c'].map do |letter|
    "#{number}:#{letter}"
  end
end
result.flatten

for ages without knowing there was a better alternative!