Package Exports
- @extra-array/copy-within
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@extra-array/copy-within) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Copies part of array within.
Alternatives: default, update.
Similar: within, another.
This is part of package extra-array.
array.copyWithin(x, j, [i], [I]);
// x: an array
// j: write index
// i: read start index (0)
// I: read end index (end)const array = require('extra-array');
var x = [1, 2, 3, 4, 5];
array.copyWithin(x, 3);
// [1, 2, 3, 1, 2]
array.copyWithin(x, 3, 1);
// [1, 2, 3, 2, 3]
array.copyWithin(x, 3, 1, 2);
// [1, 2, 3, 2, 5]