Skip to content

Instantly share code, notes, and snippets.

@syshen
Created June 27, 2012 06:17
Show Gist options
  • Select an option

  • Save syshen/3001885 to your computer and use it in GitHub Desktop.

Select an option

Save syshen/3001885 to your computer and use it in GitHub Desktop.
function test1() {
this.name = "test1";
this.print = function() {
console.log(this.name);
}
}
function test2() {
this.name = "test2";
}
var t1 = new test1();
var t2 = new test2();
var t2_print = t1.print.bind(t2);
t2_print();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment