@kdowney,
This is the example I wanted to post rather:
var Person = function () {
this.ctx = 'this is some other stuff'; // Public ;
var stuff = 'this is some stuff'; // Private
this.getThisSuff = function () { // this works
return stuff;
};
};
Person.getMyOtherStuff = function () { // this doesnt work
return (function () {return this.ctx;})();
};
Person.prototype.getMyStuff = function () { // this works
return this.ctx;
};
Person.StuffHolder = 'more stuff'; // this works
var p = new Person();
alert('1 ' + p.getThisSuff()); // works
alert('2 ' + p.getMyStuff()); // works
alert('3 ' + p.getMyOtherStuff()); // dont work, why so?