What’s the difference between using objects and functions for namespacing in Javascript?
<p>I saw these 2 basic ways of namespacing in JavaScript.</p>

<ol>
<li><p>Using object:</p>

<p><strong><code>var Namespace = { };</code></strong></p>

<p><code>Namespace.Class1 = function() { ... };</code></p></li>
<li><p>Using function:</p>

<p><strong><code>function Namespace() { };</code></strong></p>

<p><code>Namespace.Class1 = function() { ... };</code></p></li>
</ol>

<p>How do they differ? Thank you.</p>
