@writetome51/array-remove-head-tail
v2.0.0
Published
Functions that remove items from the beginning of an array or the end
Maintainers
Readme
removeHead(numItems, array): void
Removes numItems from beginning of array.
removeTail(numItems, array): void
Removes numItems from end of array.
Examples
let arr = [1, 2, 3, 4, 5, 6, 7, 8, 9];
removeHead(3, arr);
// arr is now [4, 5, 6, 7, 8, 9]
removeTail(3, arr);
// arr is now [4, 5, 6]Installation
npm i @writetome51/array-remove-head-tail
Loading
import {removeHead, removeTail} from '@writetome51/array-remove-head-tail';