I am studying TypeScript classes through official documentation: link . I used exactly the same sample code from the documentation:
class Greeter {
greeting: string;
constructor(message: string) {
this.greeting = message;
}
greet() {
return "Hello, " + this.greeting;
}
}
let greeter = new Greeter("world");
However, when trying to run the tsc greeter.ts
command to compile the above code, I'm getting the following error:
\ greeter.ts (13,5): error TS1005: ';' expected.
What's wrong?