Javascript object name usage issue.. i think
<p>So i'm setting up an object with private and public methods. Basically using the following format:</p>

<pre><code>var Utility = function() {
    var prive1, priv2, priv3;
    function privateMethod1() { //do something }

    return {
        publicFunc1: function() { //do something different }
        publicFunc2: function() { //do something else }
    }
}
</code></pre>

<p>But i'm worried about some of the situations i'm coming across where publicFunc2 needs to call publicFunc1. For Example the way I would do this atm is:</p>

<pre><code>publicFunc2: function() { Utility.publicFunc1(); //then do something else }
</code></pre>

<p>is this OK? It runs, but it seems weird and VS2010 doesn't give me . I believe that if someone was to change the line 
    var Utility = function() { --> to --> var Utility2 = function() {} 
then essentially everything would be broken from within the object and that seems wrong...
but i'm at a loss on what i should actually be changing.
Should i be making all methods basically private and then mapping to a public function? EX:</p>

<pre><code>{
    function privateFunc1() {}

    return {
        publicFunc1 : privatefunc1
    }
}
</code></pre>

<p>or should i have a completely different approach to accomplish the idea of private and public methods and variables?</p>
