mirror of
https://github.com/ruanyf/es6tutorial.git
synced 2024-04-21 12:32:22 +00:00
edit docs/symbol
This commit is contained in:
@@ -429,7 +429,7 @@ function add([x, y]){
|
||||
add([1, 2]) // 3
|
||||
```
|
||||
|
||||
上面代码中,函数`add`的参数实际上不是一个数组,而是通过解构得到的变量`x`和`y`。
|
||||
上面代码中,函数`add`的参数表面上是一个数组,但在传入参数的那一刻,数组参数就被解构成变量`x`和`y`。对于函数内部的代码来说,它们能感受到的参数就是`x`和`y`。
|
||||
|
||||
下面是另一个例子。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user