TypeScript Class Private Field Example
class Animal { private name: string;
constructor(theName: string) { this.name = theName; }}
new Animal("Cat").name;Property 'name' is private and only accessible within class 'Animal'.2341Property 'name' is private and only accessible within class 'Animal'.Try