setting a javascript / jquery function to a variable.. best practice? why?
<p>I am updating some code that was created by another developer and am noticing that there are a lot of, what I can best describe as, functions inside functions and the whole object is set to a variable.</p>

<p>For example: </p>

<pre><code>var spellcheck = {
checkone: function() {      
    &lt;....&gt;
    spellcheck.jspspellcheck.startSpellCheck( "/SpellChecker/", $(e.target).parent().prev('input:enabled, textarea:enabled') );

},  
jspspellcheck: {
    &lt;....&gt;
    startSpellCheck: function(baseUrl,elements){
        &lt;....&gt;          
        spellcheck.jspspellcheck.openCenteredWindow( );
    }
}
}
</code></pre>

<p>Obviously the above code is just a sample, but it does illistrate how a lot of the jQuery is written.</p>

<p>From the dot notation I it looks like it is making use of OO type practices, however having "functions" inside other functions gets quite confusing (at least to me).  Basically, should I try and refactor this code into different named functions or am I missing something that is a best practice?</p>
