FAQ, Int Raku, how to merge, combine two hashes?
Say:
my %a = 1 => 2;
my %b = 3 => 4, 5 => 6
How to get %c = 1 => 2, 3 => 4, 5 => 6
?
Assuming:
my %a = 1 => 'a', 3 => 4;
my %b = 1 => 'b', 5 => 6;
say %(|%a, |%b); # {1 => b, 3 => 4, 5 => 6}
say %().append(%a).append(%b); # {1 => [a b], 3 => 4, 5 => 6}
my %c = %a, %b; say(%c); # {1 => b, 3 => 4, 5 => 6}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With