Compares two arrays of objects and checks if all objects in array1 exist in array2
First array to compare
Second array to compare against
Optional
Optional key to use for faster comparison instead of full object comparison
True if all objects in array1 exist in array2, false otherwise
// With key comparisoncompareArrays([{id: 1}, {id: 2}], [{id: 1}, {id: 2}, {id: 3}], 'id') // true// With full object comparisoncompareArrays([{x: 1}, {x: 2}], [{x: 1}, {x: 2}, {x: 3}]) // true Copy
// With key comparisoncompareArrays([{id: 1}, {id: 2}], [{id: 1}, {id: 2}, {id: 3}], 'id') // true// With full object comparisoncompareArrays([{x: 1}, {x: 2}], [{x: 1}, {x: 2}, {x: 3}]) // true
Compares two arrays of objects and checks if all objects in array1 exist in array2