1
0
mirror of https://github.com/ruanyf/es6tutorial.git synced 2025-05-24 10:22:23 +00:00

docs(function): edit tail call

This commit is contained in:
ruanyf 2019-08-19 12:43:12 +08:00
parent 291f0e6198
commit 3eb580097f

View File

@ -1047,6 +1047,8 @@ function addOne(a){
上面的函数不会进行尾调用优化,因为内层函数`inner`用到了外层函数`addOne`的内部变量`one`
注意,目前只有 Safari 浏览器支持尾调用优化Chrome 和 Firefox 都不支持。
### 尾递归
函数调用自身,称为递归。如果尾调用自身,就称为尾递归。