Access modifiers in TypeScript
In TypeScript, unlike JavaScript, properties and methods can be made public, private, and protected using special keywords called access modifiers.
There are four modifiers in TypeScript: public, protected, private, and readonly. By default, i.e. if you don't specify a modifier name, all properties and functions are public and can be viewed and modified from the outside.
We will look at working with each type of modifier in detail in the following lessons.