Ещё самокат ))) ...
function compare(arr1, arr2){
if(arr1.length !== arr2.length) return false;
arr1.sort();
arr2.sort();
var i = Math.random();
return arr1.join(i) == arr2.join(i) ;
};
var a = ['a','b','c','c'], c = ['b','c','a','a'], d = ['b','c','c','a'];
alert([compare(a,c),compare(a,d)]);