3 ms·
Ruby even makes it invisible because of destructuring assignment of block variables. ruby-1.9.2-p180 > {1=>2}.each {|k,v| puts "#{k} #{v}"} 1 2 =>
by JulianMorrison 15y ago
Ruby even makes it invisible because of destructuring assignment of block variables.
ruby-1.9.2-p180 > {1=>2}.each {|k,v| puts "#{k} #{v}"}
1 2
=> {1=>2}
ruby-1.9.2-p180 > {1=>2}.sort.each {|k,v| puts "#{k} #{v}"}
1 2
=> [[1, 2]]