JSPM

@extra-array/copy-within

2.4.14
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 8
  • Score
    100M100P100Q83191F
  • License MIT

Copies part of array within.

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.
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   (x.length)
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]

references