This website requires JavaScript.
Explore
Help
Register
Sign In
rou
/
front-end-example
Watch
1
Star
0
Fork
0
You've already forked front-end-example
Code
Issues
Pull Requests
Actions
Packages
Projects
Releases
Wiki
Activity
Files
3850ce7399061a80a78e98d428de896fb5fb2333
front-end-example
/
06-typescript
/
05-generic-functions
History
rou
d5ff59ac76
update
2026-03-23 16:33:09 +08:00
..
answer.ts
feat: add TypeScript lessons and learning panel
2026-03-19 10:06:11 +08:00
README.md
feat: add TypeScript lessons and learning panel
2026-03-19 10:06:11 +08:00
starter.ts
update
2026-03-23 16:33:09 +08:00
README.md
Unescape
Escape
练习 5
:
泛型函数
目标
理解泛型是在保持输入输出类型一致。
你要练什么
泛型
<T>
输入输出同类型
任务
写一个
getData
泛型函数
传入什么类型,就返回什么类型
分别用数字和字符串调用
文件
starter.ts
answer.ts