Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save supermomonga/41e33a72f5d707959115 to your computer and use it in GitHub Desktop.
Save supermomonga/41e33a72f5d707959115 to your computer and use it in GitHub Desktop.
def hr
puts '-' * 50
end
a = [10,100,1000].each_with_object(2)
b = [10,100,1000].map{|x|[x,2]}.map
p a.class
p b.class
hr
p a.inspect
p b.inspect
hr
p [a.first, a.first.class]
p [b.first, b.first.class]
hr
p a.to_a
p b.to_a
hr
p a.map(&:to_s)
p b.map(&:to_s)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment