Answers for "TypeScript Class Private Field Example"

0

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
Posted by: Guest on July-14-2021

Code answers related to "TypeScript Class Private Field Example"

Browse Popular Code Answers by Language