Different ways of declaring variables within functions -how do they differ?
<p>I have seen two different ways to declare variables within functions. How do they differ? Thank you.</p>

<pre><code>Namespace.Class = function() {
    // first way. use "var".
    var variable1 = 'value';

    // second way. use "namespace".
    Namespace.Class.variable2 = 'value';
};
</code></pre>
