Course of Raku / Advanced / Operators / Types of Raku operators / Exercises / Subscript a hash
Solution: Subscript a hash
Here is a possible solution to the task.
Code
my %h = a => 1;
say %h<a>;🦋 You can find the source code in the file subscript-a-hash.raku.
Output
1Comments
The
< >subscript is a postcircumfix operator: it follows a term (the hash) and surrounds the key.%h<a>returns the value stored under the keya, which is1.