Oneliner: Why does this yield undefined is not a function?
<p>Why does the following line sometimes yield the message "undefined is not a function" in the chrome dev console: </p>

<pre><code>(callbackOrUndefined || function() {})();
</code></pre>

<p>The idea is to execute callback if it is truthy, i.e. a function, otherwise execute the empty function.</p>

<p>I had to replace it with :</p>

<pre><code>if (callbackOrUndefined !== undefined) callbackOrUndefined();
</code></pre>

<p>Edit: I guess I wasn't clear enough. It sometimes seem to evaluate the block to undefined(); and I don't understand how and why.</p>
