Created
October 4, 2012 22:33
-
-
Save martindevans/3836893 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
for (stuff in things) | |
{ | |
var foo = stuff.thing; | |
stuff.bar = function() | |
{ | |
foo.bash(); //Probably not what you wanted! | |
}; | |
//because all life problems can be solved with a little less readability | |
function() | |
{ | |
var foo = stuff.thing; | |
stuff.bar = function() | |
{ | |
foo.bash(); | |
}; | |
}(); | |
} | |
//http://www.lua.org/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment