How would I create an instance method with private variables?
<p>I am working through "JavaScript Web Applications" an want to append the class library I created. Here is the fiddle <a href="http://jsfiddle.net/andrewjmead/gXMp8/" rel="nofollow">http://jsfiddle.net/andrewjmead/gXMp8/</a>. Right now it works, but I remember hearing it is best to avoid using __proto__ in your code. I am currently using this to create functions to manipulate private variables.</p>

<p>Right now the Cat class inherits from the Animal class. I want to add a private variable "name" in the constructor for cat and then create a getName and setName to manipulate this value for each instance.</p>

<pre><code>Var tom = Cat("tom");
tom.setName("fud");
tom.getName(); //fud
</code></pre>

<p>Should I be using this.getName() instead of this.<strong>proto</strong>.getName(), or am I wrong altogether?</p>
