Access modifiers in Typescript

Asked

Viewed 55 times

3

In an application that uses Typescript, what is the need to use access modifiers? Because at runtime modifiers do not make sense for Javascript.

  • Do you know what access modifiers do in general? They are usually the same among languages. See What is the difference between public, default, protected and private modifiers? and Best practices regarding the use of access modifiers. Typescript works the same way, so don’t be alarmed if it is closed as duplicate.

  • 1

    @Andersoncarloswoss after transpilation these concepts do not make sense

  • So that would be a "yes" to my question that you know what each one does, correct?

  • @renanzin, the Features added by Typescript exist to offer an additional abstraction to allow the programmer to have the ability to impose some restrictions on their code so that the compiler already has errors at the time of transpilation, minimizing the need for the tedious task of debugging Javascript.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.