4 ms·
Yeah, that's a great demonstration of the technique. One tiny tip.. :) you can pass a block to `.to_h`, so instead of using `.map` + `.to_h`: h.map { |k,v
by dhotson 3y ago
Yeah, that's a great demonstration of the technique.
One tiny tip.. :) you can pass a block to `.to_h`, so instead of using `.map` + `.to_h`:
h.map { |k,v| [k, v] }.to_h
.. it can be simplified to:
h.to_h { |k,v| [k, v] }