-optionals"><span class="header-section-number">6.4.1</span> What are optionals?</h3>
<p>Ok, we know now that all objects are non-nullable by default in Zig. But what if we actually need to use an object that might receive a null value? Here is where optionals come in.</p>
<p>An optional object in Zig is rather similar to a <a href="https://en.cppreference.com/w/cpp/utility/optional.html"><code>std::optional</code> object in C++</a>. It is an object that can either contain a value, or nothing at all (a.k.a.