remove-one
Fast remove a single element from an array
Using Array.filter
you iterate over the whole array to remove just a single item. This module uses Array.findIndex
to find the item you want to remove and Array.splice
to remove it. Returns a new array.
Install
npm install remove-one
Usage
const removeOne = const array = 0 1 2 3const result = console // [0, 1, 2, 3]console // [0, 2, 3]