Skip to content

Commit 3eb5800

Browse files
committed
docs(function): edit tail call
1 parent 291f0e6 commit 3eb5800

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

docs/function.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,6 +1047,8 @@ function addOne(a){
10471047

10481048
上面的函数不会进行尾调用优化,因为内层函数`inner`用到了外层函数`addOne`的内部变量`one`
10491049

1050+
注意,目前只有 Safari 浏览器支持尾调用优化,Chrome 和 Firefox 都不支持。
1051+
10501052
### 尾递归
10511053

10521054
函数调用自身,称为递归。如果尾调用自身,就称为尾递归。

0 commit comments

Comments
 (0)