TypeScript · Classes and modules
Access modifiers
Controls compile-time visibility. ECMAScript #private fields provide real runtime privacy.
Syntax
public / private / protectedExample
Example
class Counter {
private count = 0;
increment() { return ++this.count; }
}More in this group
Learn this in the course
Reference pages are the quick answer. The course explains the why, shows the full example and ends with a challenge.