-
-
Save highwaycoder/0b75d1f24771a80a4c88 to your computer and use it in GitHub Desktop.
This file contains 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
class Foo | |
privateBar = "bar" | |
constructor: () -> | |
getPrivateBar = _.bind getPrivateBar, @ | |
getPrivateBar = () -> | |
privateBar | |
publicBar: () -> | |
getPrivateBar() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Updated to demonstrate the use of _.bind to bind private functions to the instance pointer.