We were unable to load Disqus. If you are a moderator please see our troubleshooting guide.

SirGouki • 1 year ago

The explanation of what this is doing does NOT match what it actually does: ?? returns the value on the right if the variable on the left is null, else it returns the value of the variable on the left.

The explanation given is more accurate for the ??= operator.

See https://docs.microsoft.com/...

Funnily enough, the comment provided is a better explanation than the description.

Peglo • 1 year ago

Sorry English is not my first language, how should I phrase the description?

Scubamandan • 2 years ago

Cool. So it's essentially a coalesce, such as in TSQL.

SirGouki • 1 year ago

It is referred to in the official C# documentation as a null coalescing operator, so yes.