File tree Expand file tree Collapse file tree 4 files changed +30
-2
lines changed
Expand file tree Collapse file tree 4 files changed +30
-2
lines changed Original file line number Diff line number Diff line change @@ -15,4 +15,5 @@ examples-temp
1515node_modules
1616pnpm-global
1717TODOs.md
18- /projects
18+ /projects
19+ * .apkg
Original file line number Diff line number Diff line change 1- # JSFullStack
1+ # JSFullStack
2+
3+ ## 安装
4+
5+ ``` bash
6+ npm install -g mdanki
7+ ```
8+
9+ ## 转换单个 markdown 文件
10+
11+ ``` bash
12+ mdanki ./interview/index.md anki.apkg
13+ ```
Original file line number Diff line number Diff line change 1+ ## TS 中 type 和 interface 有什么区别?
2+
3+ 1 . 从基础定义看,type 可定义基本类型、联合类型(A | B)、交叉类型(A & B);interface 更专注于对象类型的定义。
4+ 2 . 从扩展性看,type 一旦定义不可修改,需要通过交叉类型扩展;interface 支持继承和同名合并,适合动态扩展的对象。
5+ 3 . 在实践中,当需要强约束对象结构时,优先使用 interface,因为它支持合并和继承;当需要组合简单类型(如函数参数的枚举状态),type 更合适。
6+
7+ ## TS 中 never 和 void 有什么区别?
8+
9+ 1 . never 表示不可能存在的值,这类函数永远不会有返回值;void 表示有效值缺失,这类函数正常结束但没有返回值。
10+ 2 . 在实践中,never 通常用于抛出异常或无限循环,void 用于表示函数无返回值。
11+
12+ ## TS 中 any 和 unkown 有什么区别?
13+
14+ 1 . any 表示完全无类型限制;unkown 表示类型安全的未知,必须通过类型断言或类型检查后才能使用。
15+ 2 . 在实践中,any 可以临时规避类型检查;unkown 明确表示值的类型不确定,但需保持类型安全。
You can’t perform that action at this time.
0 commit comments