From 055b15f112af9efabadcb814b2077facbea23c73 Mon Sep 17 00:00:00 2001 From: nocodeempire Date: Tue, 15 Aug 2023 14:40:40 +0800 Subject: [PATCH 1/2] fix: typo --- docs/interface.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/interface.md b/docs/interface.md index a1b7c7f..4403922 100644 --- a/docs/interface.md +++ b/docs/interface.md @@ -465,7 +465,7 @@ interface A { } ``` -上面示例中,`f()`方法有一个类型声明是,参数`x`是字面量类型,这个类型声明的优先级最高,会排在函数重载的最前面。 +上面示例中,`f()`方法有一个类型声明的参数`x`是字面量类型,这个类型声明的优先级最高,会排在函数重载的最前面。 一个实际的例子是 Document 对象的`createElement()`方法,它会根据参数的不同,而生成不同的 HTML 节点对象。 From 9faa8ba76d1b42df11872b5e867987377a87763b Mon Sep 17 00:00:00 2001 From: nocodeempire Date: Tue, 15 Aug 2023 14:57:33 +0800 Subject: [PATCH 2/2] fix: typo --- docs/interface.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/interface.md b/docs/interface.md index 4403922..cf2943f 100644 --- a/docs/interface.md +++ b/docs/interface.md @@ -655,7 +655,7 @@ type Foo = { ```typescript class Calculator implements Foo { result = 0; - add(num:number) { + add(num:number) { this.result += num; return this; }