Typed Classes
Singleton
TS Syntax Pattern to ensure exactly only one object instance of a class, using Private Constructor & Static Method
Private Constructor
Constructor Function prepend with private
to restrict access to within class, prevent Instantiation with new
TS annotate the following class
class Car {}
let car = new Car()
let car: Car = new Car()