I am currently learning TS and I wanted to see if I understand the following. I know that a class in TS can include a property, a constructor, and a method. We are creating a new object with new Greeter, and running the constructor to initialize it with "world".
class Greeter {
greeting: string;
constructor(message: string) {
this.greeting = message;
}
greet() {
return "Hello, " + this.greeting;
}
}
let greeter = new Greeter("world");