mirror of
https://github.com/ruanyf/es6tutorial.git
synced 2025-05-24 18:32:22 +00:00
docs(array): fixed #868
This commit is contained in:
parent
c00389ae77
commit
b08e47e674
@ -546,7 +546,7 @@ function ArrayOf(){
|
||||
|
||||
## 数组实例的 copyWithin()
|
||||
|
||||
数组实例的`copyWithin`方法,在当前数组内部,将指定位置的成员复制到其他位置(会覆盖原有成员),然后返回当前数组。也就是说,使用这个方法,会修改当前数组。
|
||||
数组实例的`copyWithin()`方法,在当前数组内部,将指定位置的成员复制到其他位置(会覆盖原有成员),然后返回当前数组。也就是说,使用这个方法,会修改当前数组。
|
||||
|
||||
```javascript
|
||||
Array.prototype.copyWithin(target, start = 0, end = this.length)
|
||||
@ -555,8 +555,8 @@ Array.prototype.copyWithin(target, start = 0, end = this.length)
|
||||
它接受三个参数。
|
||||
|
||||
- target(必需):从该位置开始替换数据。如果为负值,表示倒数。
|
||||
- start(可选):从该位置开始读取数据,默认为 0。如果为负值,表示倒数。
|
||||
- end(可选):到该位置前停止读取数据,默认等于数组长度。如果为负值,表示倒数。
|
||||
- start(可选):从该位置开始读取数据,默认为 0。如果为负值,表示从末尾开始计算。
|
||||
- end(可选):到该位置前停止读取数据,默认等于数组长度。如果为负值,表示从末尾开始计算。
|
||||
|
||||
这三个参数都应该是数值,如果不是,会自动转为数值。
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user