What access modifiers are implied if they are not specified?

For all concepts that support access modifiers, such as fields, properties, methods, and classes that have access to modifiers, if they are not specified?

+48
access-modifiers typescript
Dec 20 '13 at 5:33
source share
2 answers

Everything in class public , if not specified. Everything in module is private unless the export keyword is used.

+63
Dec 20 '13 at 6:20
source share

I do not agree that

Everything in the class is publicly available, unless indicated.

Everything is public, even if private is used. Just look at the converted code. Private annotated methods will be available to the public. Only overflow will cause errors. Both public and private will be converted to <Object>.prototype.funcName

-2
May 25 '16 at 11:52 a.m.
source share



All Articles