class Person{
private name: string;
public constructor(name: string)
{
this.name = name
}
public getName():string{
return this.name;
}
}
var p = new Person("Jane Doe");
console.log(p.getName());
/*this example is more proper than the previous, though the previous example is syntax-wise correct*/