Skip to content

Instantly share code, notes, and snippets.

@pk11
Last active December 19, 2015 14:08
typescript - binding
class B {
boo: string = "yay!";
foo(): string {
return this.boo;
}
}
var b = new B();
console.log(b.foo()); // prints boo
var ref = b.foo;
console.log(ref()); // prints undefined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment