title: Unique ways to use the null coalescing operator
body: <p>I know the standard way of using the <a href="https://en.wikipedia.org/wiki/Null_coalescing_operator" rel="nofollow noreferrer">null coalescing operator</a> in C# is to set default values.</p>
  <pre><code>string nobody = null;
  string somebody = &quot;Bob Saget&quot;;
  string anybody = &quot;&quot;;
  
  anybody = nobody   ?? &quot;Mr. T&quot;; // Returns Mr. T
  anybody = somebody ?? &quot;Mr. T&quot;; // Returns &quot;Bob Saget&quot;
  </code></pre>
  <p>But what else can <code>??</code> be used for? It doesn't seem as useful as the <a href="https://en.wikipedia.org/wiki/%3F:" rel="nofollow noreferrer">ternary operator</a>, apart from being more concise and easier to read than:</p>
  <pre><code>nobody = null;
  anybody = nobody == null ? &quot;Bob Saget&quot; : nobody; // Returns Bob Saget
  </code></pre>
  <p>So given that fewer even know about null coalescing operator...</p>
  <ul>
  <li><p>Have you used <code>??</code> for something else?</p>
  </li>
  <li><p>Is <code>??</code> necessary, or should you just use the ternary operator (that
  most are familiar with)</p>
  </li>
  </ul>