const allEqual = arr => arr.every(v => v === arr[0]);
allEqual([1,1,1,1]); // true
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(',');
const allEqual = arr => arr.every( v => v === arr[0] )
allEqual( [1,1,1,1] ) // true
const areEqual = (arr1, arr2) =>
arr1.sort().join(',') === arr2.sort().join(',');
const arr1 = [1, 2, 3, 4];
const arr2 = [3, 4, 1, 2];
const arr3 = [1, 2, 3];
console.log(areEqual(arr1, arr2)); // true
console.log(areEqual(arr1, arr3)); // false