문제

For all of the different concepts that support access modifiers, such as fields, properties, methods and classes, which access modifiers are implied if not specified?

도움이 되었습니까?

해결책

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

다른 팁

I do not agree that

Everything in a class is public if not specified.

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top