Skip to content

Commit

Permalink
Update index.md (#14042)
Browse files Browse the repository at this point in the history
Co-authored-by: A1lo <[email protected]>
  • Loading branch information
JustWhatIam and yin1999 authored Jul 5, 2023
1 parent 9c6e33a commit 0e2cba6
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ console.log(b); // [2, 3]

要注意的是,當左邊函式裡使用其餘解構,同時使用結尾逗號,這樣會拋出例外 {{jsxref("SyntaxError")}} :

```js example-bad
const [a, ...b] = [1, 2, 3];
```js-nolint example-bad
const [a, ...b,] = [1, 2, 3];
// SyntaxError 語法錯誤: 其餘元素不可以跟隨結尾逗號
// 需要把其餘運算子放在最後的元素
Expand Down

0 comments on commit 0e2cba6

Please sign in to comment.