Skip to content

Commit bb828d8

Browse files
committed
docs(array): edit spread ruanyf#846
1 parent a4956cb commit bb828d8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/array.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const arr = [
5858
// [1]
5959
```
6060

61-
注意,扩展运算符如果放在括号中,JavaScript 引擎就会认为这是函数调用。如果这时不是函数调用,就会报错
61+
注意,只有函数调用时,扩展运算符才可以放在圆括号中,否则会报错
6262

6363
```javascript
6464
(...[1, 2])
@@ -71,7 +71,7 @@ console.log(...[1, 2])
7171
// 1 2
7272
```
7373

74-
上面前两种情况都会报错,因为扩展运算符所在的括号不是函数调用,而第三种情况`console.log(...[1, 2])`就不会报错,因为这时是函数调用
74+
上面三种情况,扩展运算符都放在圆括号里面,但是前两种情况会报错,因为扩展运算符所在的括号不是函数调用
7575

7676
### 替代函数的 apply 方法
7777

0 commit comments

Comments
 (0)