UNPKG
arr-exclude
Version:
latest (2.0.0)
2.0.0
1.0.0
Exclude certain items from an array
github.com/sindresorhus/arr-exclude
sindresorhus/arr-exclude
arr-exclude
/
index.js
8 lines
(6 loc)
•
221 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
export
default
function
arrayExclude
(
array, exclusions
) {
if
(!
Array
.
isArray
(array)) {
throw
new
TypeError
(
`Expected an array, got \`
${
typeof
array}
\``
); }
return
array.
filter
(
item
=>
!exclusions.
includes
(item)); }