Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update array.md 应该是 arr1[2][0] 而不是 arr1[1][0]。 #445

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions docs/es6/array.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,13 @@ const arr3 = ['d', 'e'];
下面看个例子就清楚多了

```js
const arr1 = ['a', 'b',[1,2]];
const arr1 = ['a', 'b', [1, 2]];
const arr2 = ['c'];
const arr3 = [...arr1,...arr2]
arr[1][0] = 9999 // 修改arr1里面数组成员值
console.log(arr[3]) // 影响到arr3,['a','b',[9999,2],'c']
const arr3 = [...arr1, ...arr2];

arr1[2][0] = 9999; // 修改 arr1 中的数组成员值
console.log(arr3); // 输出 ['a', 'b', [9999, 2], 'c']

```

扩展运算符可以与解构赋值结合起来,用于生成数组
Expand Down