Null-coalescing in Javascript?
<p>In C# you can do the following:</p>

<pre><code>string y = null;
string x = y ?? "sup stallion"; //x = "sup stallion" since y is null.
</code></pre>

<p>Where The <code>??</code> operator is the null-coalescing operator.</p>

<p>And in Javascript I've seen something similar:</p>

<pre><code>var headers;
var myHeader = headers || {'Content-type':'text/plain'}; //myHeaders = {'Content...
</code></pre>

<p><a href="http://csausdev.wordpress.com/2010/12/17/dependency-injection-in-node-js/" rel="nofollow">I've also seen: (The 2nd code snippet on the page)</a></p>

<pre><code>var headers;
var myHeader = headers | {'Content-type':'text/plain'};
</code></pre>

<p>Is there a difference between the two? What is this pattern called...default parameter?</p>
