Why we should check for the variable being defined var m = m || function(){}
<p>Lot of libraries i have seen methods defined like this</p>

<pre><code>Common.deepCopy = Common.deepCopy || function(oldObject) {
        return $.extend(true, {}, oldObject);
    };
</code></pre>

<p>What is the need of defining methods are objects like this.</p>

<p>Because the js files will be executed only once so there is no chance of deepCopy being defined previously.</p>
