Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!
  • Ruby

Idiom #298 Copy a map

Create the map y by cloning the map x.

y is a shallow copy, not a deep copy.

y = x.dup
var y = Map.of(x);

New implementation...