Removes the first occurrence of an element from an array. If the element does not exist in the array, nothing is done.
Note that the input array is being mutated.
2.8.0
lodash.pullAt
The mutated array.
const a = ["foo", "bar", "fizz", "bar"];removeItem(a, "bar")// => ["foo", "fizz", "bar"]const b = ["foo", "bar", "fizz", "bar"];removeItem(b, "bazz")// => ["foo", "bar", "fizz", "bar"]
Array to modify.
The value to remove.
Generated using TypeDoc
Removes the first occurrence of an element from an array. If the element does not exist in the array, nothing is done.
Note that the input array is being mutated.
Since
2.8.0
See
lodash.pullAt
Returns
The mutated array.
Example