指在定义函数、接口或类的时候,没有定义具体类型,等到使用的时候才指定具休类型的特征 在函数名后使用 <>,在其中定义泛型参数 function createArray<T>(length: number, value: T): T[] { const arr = Array<T>(length).fill(value); return arr;}