Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 28f2a3f

Browse files
authored
add instruction for interface function
1 parent 494ac4a commit 28f2a3f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

basics/type-of-function.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ mySearch = function(source: string, subString: string) {
8585
}
8686
```
8787

88+
采用函数表达式|接口定义函数的方式时,对等号左侧进行类型限制,可以保证以后对函数名赋值时保证参数个数、参数类型、返回值类型不变。
89+
8890
## 可选参数
8991

9092
前面提到,输入多余的(或者少于要求的)参数,是不允许的。那么如何定义可选的参数呢?

0 commit comments

Comments
 (0)