Object equals self or empty object
<p>I've got a JavaScript that uses this notation to make sure an object is initialized:</p>

<pre><code>MyObject = MyObject || {};
</code></pre>

<p>I understand what it does, namely checking wether MyObject is anything, if not assigning an empty object to <code>MyObject</code>. I don't really know all the internals of JS that well, so I don't see how a logic comparison could be used in an assignment.</p>

<p>How does it work? Is there any other languages that allows this?</p>
