Skip to content

Commit 642a4ab

Browse files
committedJun 8, 2024·
docs(array): fixed wangdoc/es6-tutorial#22
1 parent 9c0896c commit 642a4ab

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed
 

‎docs/array.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -881,9 +881,7 @@ sentence.at(100) // undefined
881881

882882
## 实例方法:toReversed(),toSorted(),toSpliced(),with()
883883

884-
很多数组的传统方法会改变原数组,比如`push()``pop()``shift()``unshift()`等等。数组只要调用了这些方法,它的值就变了。现在有一个[提案](https://github.com/tc39/proposal-change-array-by-copy),允许对数组进行操作时,不改变原数组,而返回一个原数组的拷贝。
885-
886-
这样的方法一共有四个。
884+
很多数组的传统方法会改变原数组,比如`push()``pop()``shift()``unshift()`等等。数组只要调用了这些方法,它的值就变了。[ES2023](https://github.com/tc39/proposal-change-array-by-copy)引入了四个新方法,对数组进行操作时,不改变原数组,而返回一个原数组的拷贝。
887885

888886
- `Array.prototype.toReversed() -> Array`
889887
- `Array.prototype.toSorted(compareFn) -> Array`

0 commit comments

Comments
 (0)
Please sign in to comment.