Typescript classes

From wikinotes
Revision as of 00:37, 17 December 2022 by Will (talk | contribs) (Created page with "= Example = <blockquote> <syntaxhighlight lang="typescript"> class User { id: string; constructor(name: string) { this.id = "12345"; } } let user = new User("vaderd"); </syntaxhighlight> </blockquote><!-- Example -->")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Example

class User {
    id: string;
    constructor(name: string) {
        this.id = "12345";
    }
}

let user = new User("vaderd");