javascript property accessors
In Javascript, it seems like using property accessors is not all that common (unlike in other OO languages such as Java for example). If I have a Person object with a name, defined as function Person(name) { this.name = name; } A person's name is not going to change, but I do want to be able to access it when needed, so I could do something like: function Person(name) { var name = name; this.getName = function() { return name; } } Even in a dynamic language, I think the principles of using getters and setters apply the same way they do to statically typed OO languages (e.g. encapsulation,