Created
January 10, 2015 00:06
-
-
Save tkissing/6debd663d82c160bf241 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function A() { | |
| function privateA() {} | |
| function privateB() {} | |
| function publicA() { | |
| // now this.publicB() here, just publicB() - safes typing and even if someone overrides publicB we still use the implementation from here | |
| // of course that latter might not be desired, in which case you'd write this.publicB() here | |
| return publicB() ? privateA() : privateB(); | |
| } | |
| this.publicA = publicA; | |
| function publicB() {} | |
| this.publicB = publicB; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment