Basics

Challenges

Classes

Cookies

Debugging

Events

External Files

Flow Control

Forms

Functions

Html Elements

Installation

Interfaces

Keywords

Modules

Namespaces

Operators

Reference Files

String

Types

TypeScript - Access Modifers

 

  • Everything is public unless specifically declared
  • private means that only members within the same class can access it
  • protected means that only members within the same class or classes which inherit (using extends) the class can access it
  • const is for static variables
  • readonly is for static class properties

The alert on this page is a demonstration on how ClassB used a protected field from ClassA.