How to make class fields or methods accessible only to class and subclass in TypeScript?
Originally Published Here ๐!
To make class fields or methods accessible only to the class and to the subclasses, we have to use the keyword protected before writing the class field and methods in TypeScript.
TL;DR
// a simple class
class Person {
...
melvingeorge-me.hashnode.dev5 min read