Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //standard pattern
- var MyClass = function() {
- this.func1 = function() {
- //dostuff
- };
- };
- MyClass.prototype.func2 = function() {
- this.func1();
- //dostuff
- };
- //revealing class pattern
- var MyClass = function() {
- function privateFunc() {
- //dostuff
- }
- function publicFunc() {
- privateFunc();
- //dostuff
- }
- this.publicFunc = publicFunc;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement