Values & References6 / 14
Up next

Nullable references

string? maybe = null;
// ?? supplies a fallback when null
Console.WriteLine(maybe ?? "fallback");
// ?. short-circuits to null instead of throwing
Console.WriteLine(maybe?.Length ?? -1);
What you're solving

? marks a maybe-null reference