Skip to content

Instantly share code, notes, and snippets.

@brianium
Created March 13, 2012 14:49
Show Gist options
  • Save brianium/2029233 to your computer and use it in GitHub Desktop.
Save brianium/2029233 to your computer and use it in GitHub Desktop.
bindless closure
var obj = {
method: function(name){
this.name = name;
console.log(this.name);
var self = this;
var inner = function(msg) {
console.log(msg + " " + self.name);
};
inner('hello');
}
};
obj.method.bind(obj,"Brian")()
//Brian
//hello Brian
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment