Under the section "The Property (object attribute)" the code segment has two curious lines. I expect the first cancels out the latter, making the latter useless.<p><pre><code> // in Person function
this.gender = gender;
// outer scope (gender will never be this value because it is overridden by the person constructor argument)
Person.prototype.gender = 'Person Gender';
</code></pre>
Am I correct, or does the prototype.gender line have some other purpose than instantiating gender to a value that is immediately overridden by the passed in value (or undefined if no value is passed)?
Might want to check the Joose object system (<a href="http://joose.it/" rel="nofollow">http://joose.it/</a> #joose on irc.freenode.net), highly inspired in the awesome thing that Moose (<a href="http://search.cpan.org/dist/Moose/" rel="nofollow">http://search.cpan.org/dist/Moose/</a>) is to Perl. There's even a port of KiokuDB as KiokuJS!(<a href="http://joose.it/blog/2011/01/13/introducing-kiokujs/" rel="nofollow">http://joose.it/blog/2011/01/13/introducing-kiokujs/</a>) :)
It's good to know this stuff, but in my real-world usage of JavaScript, I've become a big fan of Backbone.js to help structure code intelligently, etc.