Is there a "typical" usage for private variables?
<p>First, my experience with JavaScript is limited to web development and a little self-study.  I want to understand the point of having private members in JavaScript.  Take an example,</p>

<pre><code>var myObject = {
    WriteWord: function() {
        var secret = 'word';
        document.writeln(secret);  
    }
};

myObject.WriteWord();
</code></pre>

<p>Private variable <code>secret</code> cannot be seen by the caller.  AFAIK, I can notify potential callers of the existence of <code>WriteWord</code> in a few ways:</p>

<ol>
<li>Document the code.  <a href="http://api.jquery.com/" rel="nofollow">Like jQuery does</a>.</li>
<li>For .NET guys, write a custom visual studio intellisense plugin.</li>
<li>Read the code directly.</li>
</ol>

<p>Now let's say I minify and even obfuscate the code.  Its now unreadable.  In my mind, given this scenerio, a lack of documentation is just as good as a private variable.</p>

<p>Is this scenerio uncommon or somehow wrong?  What is the importance of private variables in JavaScript?  </p>
