Skip to content

Commit

Permalink
docs(function): fixed #102
Browse files Browse the repository at this point in the history
  • Loading branch information
ruanyf committed Mar 21, 2024
1 parent 5d4a2f1 commit d5e0f47
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/function.md
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,8 @@ function arraySum(

上面示例中,参数`arr`的类型是`readonly number[]`,表示为只读参数。如果函数体内部修改这个数组,就会报错。

注意,`readonly`关键字目前只允许用在数组和元组类型的参数前面,如果用在其他类型的参数前面,就会报错。

## void 类型

void 类型表示函数没有返回值。
Expand Down

0 comments on commit d5e0f47

Please sign in to comment.