Function that removes adjacent items from array
Beginning at startingIndex
, it removes howMany
adjacent items from array
.startingIndex
can be negative or positive.
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]
npm i @writetome51/array-remove-adjacent-at
import {removeAdjacentAt} from '@writetome51/array-remove-adjacent-at';