Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

generic typescript

class Greeter<T> {
  greeting: T
  constructor(message: T) {
    this.greeting = message
  }
}

let greeter = new Greeter<string>('Hello, world')
Source by devhints.io #
 
PREVIOUS NEXT
Tagged: #generic #typescript
ADD COMMENT
Topic
Name
6+5 =