Pointy is using the wrong pattern for private shared members, the pattern is for private instance specific members and every instance will have it's own addressMe function.
The pattern for private shared members could wrap the prototype in an IIFE:
var People = function(firstName, lastName){
// public
this.firstName = firstName;
this.lastName = lastName;
};
(function(){
// private shared member
var full_name = function(){
return this.firstName + ' ' + this.lastName;
};
//privileged member that has access to private shared
// fullName is a closure and full_name is available
// in the colosure scope created for this function
People.prototype.fullName = function(){
//calling private member, make sure you set
// the invoking object (this) by using
// Function.prototype.call
console.log(full_name.call(this));
return this;
};
}());
var person = new People('John', 'Smith');
person.fullName();
You can't use this pattern for instance specific private members but the function full_name is not instance specific.
A pattern for protected and more info on prototype and constructor functions can be found here.