Array.copyWithin
copyWithin — Copies a subset of the array and pastes over the array's current values starting at target.
Description
Array.copyWithin(integer target, integer start, [integer end])
Parameters
Name | Description | Type | Default | Optional |
---|---|---|---|---|
target | integer | No | ||
start | integer | No | ||
end | integer | Yes |
Return values
The array with the filled values.
Changelog
Version | Description |
---|---|
ES 6 | Introduced. |
Examples
Example #1 – copyWithin example
The array is overwritten when filling.