how do you diff two arrays in javascript code example
Example 1: javascript difference between two arrays
let difference = arr1.filter(x => !arr2.includes(x));
Example 2: compare between two arrays javascript
const equals = (a, b) => JSON.stringify(a) === JSON.stringify(b);
let arr1 = ['1','2'];
let arr2 = ['1','2'];
equals(arr1,arr2)//this return false , if not equal then its return false