I've been seeing statements like this a lot:
int? a = 5;
//...other code
a ??= 10;
What does the ??= mean in the second line? I've seen ?? used for null coalescing before, but I've never seen it together with an equals sign.
I've been seeing statements like this a lot:
int? a = 5;
//...other code
a ??= 10;
What does the ??= mean in the second line? I've seen ?? used for null coalescing before, but I've never seen it together with an equals sign.
Copyright © 2021 Jogjafile Inc.
It's the same as this:
It's an operator introduced in C# 8.0: https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/null-coalescing-operator