Loading...

Other Binary Operators

Null coalescing operator.

??

The ?? operator checks whether the value provided on the left side of the expression is null, and if so it returns an alternate value indicated by the right side of the expression. If the value provided on the left side of the expression isn't null, then it returns the original value.

Example

null ?? "Hello" returns the string Hello 0 ?? "Hello" returns 0.