UNPKG
@irrelon/forerunnerdb-core
Version:
latest (3.2.0)
3.2.0
3.1.2
3.1.1
3.1.0
3.0.2
3.0.1
3.0.0
ForerunnerDB core utilities for operating on JSON data.
github.com/irrelon/fdb-core
irrelon/fdb-core
@irrelon/forerunnerdb-core
/
src
/
utils
/
pull.js
8 lines
(7 loc)
•
187 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
export
const
pull
= (
arr, itemToRemove
) => {
return
arr.
reduce
(
(
newArr, arrItem
) =>
{
if
(itemToRemove === arrItem)
return
newArr; newArr.
push
(arrItem);
return
newArr; }, []); };