function isEqual(a, b){
return a.join() == b.join();
}
let a = ['J','a','v','a'];
let b = ['s','c','r','i','p','t'];
console.log(isEqual(a, b)); //false
const a = ['Left', 'Right'];
const b = ['Right', 'Left'];
// true if a and b contain the same values
// false otherwise
const c = a.sort().join(',') === b.sort().join(',');
function arraysAreIdentical(arr1, arr2){
if (arr1.length !== arr2.length) return false;
for (var i = 0, len = arr1.length; i < len; i++){
if (arr1[i] !== arr2[i]){
return false;
}
}
return true;
}
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