Skip to content

Commit 90aded3

Browse files
authored
Merge pull request #122 from GuoXiCheng/dev-c
update
2 parents 06c24c5 + b0db85e commit 90aded3

File tree

4 files changed

+30
-2
lines changed

4 files changed

+30
-2
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@ examples-temp
1515
node_modules
1616
pnpm-global
1717
TODOs.md
18-
/projects
18+
/projects
19+
*.apkg

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,13 @@
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+
```

interview/archive.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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 明确表示值的类型不确定,但需保持类型安全。

interview/index.md

Whitespace-only changes.

0 commit comments

Comments
 (0)