Skip to main content
Journey Uncommon Logo
JourneyUncommon
easyRubyarrays push map selectSingle-choice MCQ

What is the difference in result between these two lines?

a = [1, 2, 3] x = a.map { |n| n * 2 } y = a.each { |n| n * 2 }