Course of Raku / Advanced / More about built-in types / Native types 🆕 / Exercises

The native default

Problem

The rule that a native variable can never be undefined applies to every native type, not just int. Declare an unassigned native num and an unassigned native str. Print the number, and then print the string inside square brackets so its emptiness is visible.

Example

The program prints:

0
[]

Solution

See the solution

Course navigation

Quiz — Overflow   |   Solution: The native default