class Person{
public name: string;
public constructor(name: string)
{
this.name = name
}
}
var p = new Person("Jane Doe");
console.log(p.name);
/*for typescript, you need to not only specify the type in the normall places(e.g. constructor instead of name is name:string), but you also need to specify what the methods are above the constructor*/
/*not necessarily the recommended format for getting name, but at least this is gramatically correct*/