JSPM

@writetome51/array-remove-between

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

Function removes chunk of adjacent items from the middle of the array

Package Exports

  • @writetome51/array-remove-between

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 (@writetome51/array-remove-between) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

You call this function when you want to remove a big chunk of adjacent items from the middle of the array, but know you want to keep an exact number of items at the beginning and end. You pass that number as the first argument. Example:

let arr = [1,2,3,4,5,6,7,8,9,10];

removeBetween(3, arr); // Keeps first 3 items and last 3 items.

arr is now [1, 2, 3, 8, 9, 10]