Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

TypeScript Class Example

class Animal {  public name: string;
  public constructor(theName: string) {    this.name = theName;  }
  public move(distanceInMeters: number) {    console.log(`${this.name} moved ${distanceInMeters}m.`);  }}Try
Source by www.typescriptlang.org #
 
PREVIOUS NEXT
Tagged: #TypeScript #Class #Example
ADD COMMENT
Topic
Name
5+9 =