What is array-differ?
The array-differ npm package is a simple utility that allows you to find the difference between two arrays, essentially returning elements that are present in the first array but not in the second. It is useful for filtering out unwanted elements when comparing lists.
Array Difference
This code sample demonstrates how to use array-differ to find the difference between two arrays. It filters out elements from the first array that are not present in the second array, returning [1] in this case.
[1, 2, 3].filter(element => !['2', '3', '4'].includes(element))