Course of Raku / Advanced / Containers / Contexts 🆕 / Exercises / A Boolean check
Solution: A Boolean check
Here is a possible solution to the task.
Code
my @empty;
say ?@empty;🦋 You can find the source code in the file boolean-check.raku.
Output
FalseComments
The
?prefix forces Boolean context.An empty array is false, which is exactly what
if @arrayrelies on.
Course navigation
← A Boolean check | Item or list →