JSPM

@writetome51/array-remove-adjacent-at

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

Removes adjacent items from an array, beginning at a chosen index

Package Exports

  • @writetome51/array-remove-adjacent-at

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-adjacent-at) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

removeAdjacentAt(
       startingIndex,
       howMany,
       array
): void

Beginning at startingIndex, it removes howMany adjacent items from array.
startingIndex can be negative or positive.

Examples

let arr = [10,20,30,40,50,60,70,80,90];  
removeAdjacentAt(-4, 2, arr);  
// arr is now  [10,20,30,40,50,80,90]

let arr = [10,20,30,40,50,60,70,80,90];  
removeAdjacentAt(2, 4, arr);  
// arr is now  [10,20,70,80,90]

Installation

npm i @writetome51/array-remove-adjacent-at

Loading

import {removeAdjacentAt} from '@writetome51/array-remove-adjacent-at';