Generics
Example with a class
Section titled “Example with a class”class HoldAnything<T> { // T is the name usually given to the generic 'type of data' data: T}
const holdNumber = new HoldAnything<number>()holdNumber.data = 123const holdString = new HoldAnything<string>()holdString.data = 'Hello Wall-e'