Last active
December 14, 2015 18:38
-
-
Save synaptiko/5130458 to your computer and use it in GitHub Desktop.
Two interesting examples from http://ashkenas.com/dotjs/ which I don't know about
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
# ... with if/else | |
class Pirate | |
if century > 1700 | |
loot: -> | |
say 'Give me the gold!' | |
else | |
loot: -> | |
say 'Dame el oro!' | |
# ... and with wrapped functions | |
class Pirate | |
loot: heartily -> | |
say 'Give me the gold!' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment