-
-
Save GarconsdeCrystal/9c3d7bf44f87a233043519f80873f9fe to your computer and use it in GitHub Desktop.
Private instance variable in LiveScript
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 Container | |
-> | |
secret = 3 | |
@dec = -> | |
return false unless secret > 0 | |
return secret-- | |
x = new Container | |
console.log x.dec! | |
console.log x.dec! | |
console.log x.dec! | |
console.log x.dec! | |
y = new Container | |
console.log y.dec! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment