Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

Save syshen/3001831 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();
t1.print.call(t2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment