Course of Raku / Advanced /
Debugging / Debugging with dd / Exercises / Dump a hash
Solution: Dump a hash
Here is a possible solution to the task.
Code
my %h = beta => 2, alpha => 1;
dd %h;🦋 You can find the source code in the file dump-a-hash.raku.
Output
{:alpha(1), :beta(2)}Comments
ddprints the hash in a code-like form, with each pair as:key(value).The keys come out in sorted order —
alphabeforebeta— even thoughbetawas written first.
Course navigation
← Dump a hash | Containers →