TypeScript defines a constructor using the constructor keyword . A constructor is a function and hence can be parameterized. The this keyword refers to the current instance of the class. Here, the parameter name and the name of the class’s field are the same.1 Ağu 2010