Created
          April 1, 2011 12:37 
        
      - 
      
 - 
        
Save fletcherm/898083 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
    
  
  
    
  | window.Matt = {} | |
| Matt.Printer = (-> | |
| message1 = "Yo ho ho" | |
| message2 = "Five dwarves" | |
| print1 = -> | |
| console.log message1 | |
| print2 = -> | |
| console.log message2 | |
| { | |
| print1: print1 | |
| print2: print2 | |
| } | |
| )() | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
            
There's also the
dokeyword for immediately executing function expressions: https://gist.github.com/1238400. Makes the example a little bit nicer