TypeScript – Access Modifiers and Properties

There are two access modifiers (public and private), which control the accessibility of the properties of a class.

Default setting is public, for example :

class user {
    userId: number;
    public userName: string;
    private address: string;
}

“userId" and “userName" are public and “address" is private.

TypeScript – Access Modifiers and Properties

對「TypeScript – Access Modifiers and Properties」的想法

  1. I’ve been browsing online more than 2 hours today, yet I never found any interesting article like yours.
    It is pretty worth enough for me. In my opinion, if all webmasters
    and bloggers made good content as you did, the web will be much more useful than ever
    before.

發表留言