Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
class Person {
name: string;
constructor(name: string) {
this.name = name;
}
sayHello(): string {
return `Hello ${this.name}, Welcome to Ditty.ir`;
}
}
let p = new Person("Rafael Nadal");
console.log(p.sayHello());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment