const a =['Left','Right'];const b =['Right','Left'];// true if a and b contain the same values// false otherwiseconst c = a.sort().join(',')=== b.sort().join(',');
functionarraysAreIdentical(arr1, arr2){if(arr1.length!== arr2.length)returnfalse;for(var i =0, len = arr1.length; i < len; i++){if(arr1[i]!== arr2[i]){returnfalse;}}returntrue;}
constequals=(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