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. // 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'; Am I correct, or does the prototype.gender line have some othe…
A way I'd prefer might look like this:
function Person = function(gender) {
this.gender = gender || 'neuter' //the sauce that defines a fallback
}