Parameter Properties and Shortcut Constructor in Typescript

  • TypeScript offers a shortcut syntax for creating constructors.
  • It helps to minimize some of the boilerplate code for constructors and also for defining and assigning properties.

 

 

Traditional Apporoach

  • properties and initialization seperatly

 

Shortcut Approach

  • The Parameter Properties approach 
    • This defines the properties and also assigns them at the same time.
    • Parameter Properties in action

 

 


Related Question