Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

typescript final example

class Person {
 protected readonly name: string = "jane doe"
 
 protected setName(): string {
   this.name = "john doe"
   return this.name
 }
 
 public resultData(): string {
     return `My name is ${this.setName()}`
  }
}

const res = new Person()
console.log(res.resultData())
 
PREVIOUS NEXT
Tagged: #typescript #final
ADD COMMENT
Topic
Name
1+3 =