DEV Community

Calin Baenen
Calin Baenen

Posted on

Typescript Example #1.

// An example of generics in TypeScript.
class Option<T> {
    constructor(v:T|null=null) { this.value = v; }
    readonly value:T|null;
}
Enter fullscreen mode Exit fullscreen mode

Top comments (0)