Created
May 1, 2014 18:50
-
-
Save declaresub/8a056ba75395d63f9808 to your computer and use it in GitHub Desktop.
Simple javascript thunk example
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
var X = | |
{ | |
foo: function() | |
{ | |
var bar=function(){return 'Thunk!';}; | |
this.foo = bar; | |
return bar.call(this); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment