Skip to content

Instantly share code, notes, and snippets.

@Raynos
Forked from tommedema/gist:993989
Created May 26, 2011 20:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Raynos/994015 to your computer and use it in GitHub Desktop.
Save Raynos/994015 to your computer and use it in GitHub Desktop.
var someFunc = new (function() {
var me = this,
foobar = "twenty";
me.something = "foo";
somethingElse.on('someEvent', function() {
//this points to somewhere else now
me.something = 'hi';
foobar = 42;
});
somethingElse.on('FooBar', (function() {
//this points to somewhere else now
this.something = 'hi';
}).bind(me));
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment