Skip to content

Instantly share code, notes, and snippets.

@jcchurch
Created September 8, 2020 06:50
Show Gist options
  • Save jcchurch/e7af40850a69e2f50b55f9931aadfdbf to your computer and use it in GitHub Desktop.
Save jcchurch/e7af40850a69e2f50b55f9931aadfdbf to your computer and use it in GitHub Desktop.
class MyClass {
myVar: string = "Hello ";
greet(name: string) {
return this.myVar + name;
}
}
let x = new MyClass();
console.log(x.greet("James"));
let y = x.greet;
console.log(y("James"));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment