⬅️ FEM TypeScript Fundamentals
Classes
Access modifier keywords (great for encapsulation, but not security!):
-
publiceveryone (this is the default) -
protectedthe instance itself, and subclasses -
privateonly the instance itself -
Classes have fields (data) and methods (functions), both of which need static types. Fortunately, fields use syntax similar to variables, and methods use syntax similar to functions.