Files
charlie f3bdaa4e88 feat: add TypeScript lessons and learning panel
- Introduced a new script to check TypeScript lesson files for errors.
- Created a main TypeScript file to render lessons and their details.
- Added lesson definitions with starter and answer codes.
- Implemented a user interface for navigating and running lessons.
- Styled the application with CSS for a better user experience.
- Updated README to reflect the new TypeScript section and usage instructions.
2026-03-19 10:06:11 +08:00

533 B
Raw Permalink Blame History

练习 1JavaScript 和 TypeScript 的差别

目标

理解 TypeScript 为什么能在写代码时提前发现类型问题。

你要练什么

  • 参数类型
  • 返回值类型
  • 类型报错的意义

任务

  • 观察 add 函数的类型标注
  • 看懂为什么 add(1, "2") 会在 TypeScript 里报错

文件