Skip to content

Instantly share code, notes, and snippets.

@cyrilletuzi

cyrilletuzi/class.ts

Created Jan 29, 2017
Embed
What would you like to do?
class User {
public firstName: string; // TypeScript only
public constructor(firstName: string) {
this.firstName = firstName;
}
public sayHello(): void {}
}
let myUser: User = new User(`Henri`);
myUser.firstName;
myUser.sayHello();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment