Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var Person = (function () {
- // constructor
- function Person(name) {
- this.name = name;
- alert(this.getName());
- }
- // instance methods
- Person.prototype = {
- // public
- getName: function () {
- return this.name;
- },
- // "private" (we are all adults here....)
- _private: function () {
- }
- };
- // class method
- Person.blah = function () { alert('blah')}
- return Person;
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement