Course of Raku / Advanced / Containers / Subscript adverbs 🆕 / Exists and delete

Quiz — Subscript adverbs

What does the following program print?

my %h = a => 1, b => 2;
say %h<z>:exists;
0True
1False
0Nil
0(Any)

The :exists adverb asks whether the key is present and returns a Boolean. There is no z key in the hash, so the answer is False.

Course navigation

Exists and delete   |   Keys, values, and pairs