JavaScript: Is "z=(x||y)" same as "z=x?x:y" for non-boolean?
<p>In JavaScript when is it correct and cross-browser to use</p>

<pre><code>z = (x || y);
</code></pre>

<p>instead of </p>

<pre><code>z = (x ? x : y);
</code></pre>

<p>? Can I do that with all kind of variables (e.g. string, function, ...)?</p>

<p>Please provide link to a reference.</p>
