sparse-splice
v1.0.1
Published
remove elements scattered over an array
Downloads
9
Readme
sparse-splice
Like Array.splice
but instead of removing a consecutive range of elements this module allows for the elements to be scattered all over the array.
Installation
npm install --save sparse-splice
Usage
var cats = [ 'Dusty'
, 'Casper'
, 'Samantha'
, 'Maggie'
, 'Chester'
, 'Sadie'
, 'Coco'
, 'Lola'
]
// Remove Sadie, Coco and Maggie
require('sparse-splice')(cats, [5, 6, 3])
// cats = ['Dusty', 'Casper', 'Samantha', 'Chester', 'Lola']