Generic and Classes
This lesson delves into making classes more reusable with generic types.
We'll cover the following...
We'll cover the following...
A simple class #
Engineers with an object-oriented background may associate the concept of generic with classes. It is a mechanism to generalize a class, to avoid duplicating the definition for each flavor of a class.
The code above might work even if we pass a different class object i.e. Lion or Tulip (which is not considered a good coding practice and may cause mayhem) to it because TypeScript is structural based and not nominal, which means it does not rely on the name but on the ...