Typescript classes: Difference between revisions

From wikinotes
(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 -->")
(No difference)

Revision as of 00:37, 17 December 2022

Example

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

let user = new User("vaderd");