0%

基础类型系统

第二阶段:基础类型系统

目标:掌握 TypeScript 提供的基础与特殊类型。

1. 原始类型 学习原始类型

  • boolean、number、string
  • null、undefined、void

2. 特殊类型 学习特殊类型

  • any(任意类型)
  • unknown(安全的任意类型)
  • never(不可能的值)
  • object(非原始类型)

3. 断言与推断 学习断言与推断

  • 类型断言(as、! 非空断言)
  • as const 与 satisfies
  • 类型推断机制(自动识别变量类型)