Best way to organize a javascript application
<p>I have been trying out some different ways to organize my code in my javascript applications and i wonder which one is the most appropriate.</p>

<p>First example:</p>

<pre><code>var Application = {

    init: function() {
        //Some code
        Calculate();
    },

    Calculate: function() {
        //Some code
    }
};
</code></pre>

<p>Second example:</p>

<pre><code>(function() {

    function init() {
        //Some code
        Calculate();
    }

    function Calculate() {
        //Some code
    }

})();
</code></pre>

<p>Third example:</p>

<pre><code>(function() {

    var init = function() {
        //Some code
        Calculate();
    };

    var Calculate = function() {
        //Some code
    };

})();
</code></pre>

<p>Or is it some other way that is preferred? I get very confused over this. Thanks in advance!</p>
