Course of Raku / Advanced / Operators / Types of Raku operators

Quiz — Operator categories

In the expression @a[0], what category does the [0] subscript belong to?

0postfix
1postcircumfix
0circumfix
0infix

A subscript surrounds its content with brackets and follows a term (here @a), which makes it a postcircumfix operator. A plain postfix (like ++) takes no surrounding brackets, and a circumfix (like the array constructor [1, 2, 3]) surrounds but does not follow a term.

Course navigation

Solution: Subscript a hash   |   Quiz — Prefix or postfix