UNPKG

array-differ

Version:

Create an array with values that are present in the first input array but not additional ones

5 lines (4 loc) 154 B
export default function arrayDiffer(array, ...values) { const rest = new Set([...values].flat()); return array.filter(element => !rest.has(element)); }