Simply remove an item from an array.
npm install --save remove-from-array
const removeFromArray = require('remove-from-array')
let array = [1, 2, 3, 4]
removeFromArray(array, 2)
removeFromArray(array, 4)
console.log(array) // [1, 3]
Removes the item item
from the array array
. Throws a RangeError
if the item cannot be found.