Array Difference

Find elements in the first array that are not present in the second array.

Code

General
const b = new Set(arr2);
return arr1.filter(x => !b.has(x));

Parameters

First array

Second array

Browser·fetch() may be limited by CORS

More JavaScript Snippets