-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
说一说Typescript中的泛型的作用及使用场景。 #6
Comments
waiting for the answer |
什么是TypeScript
为什么要使用TypeScript
什么是泛型泛型的本质是参数化类型,通俗的将就是所操作的数据类型被指定为一个参数,这种参数类型可以用在类、接口和方法的创建中,分别成为泛型类,泛型接口、泛型方法。
为什么使用泛型TypeScript 中不建议使用 any 类型,不能保证类型安全,调试时缺乏完整的信息。 TypeScript可以使用泛型来创建 泛型的使用使用泛型可以创建泛型函数、泛型接口,泛型类 1.使用泛型变量
2.定义泛型函数
3.定义泛型接口
4.定义泛型类
|
说一说Typescript中的泛型的作用及使用场景。
The text was updated successfully, but these errors were encountered: