a={a:1}; b={b:2}; arr1 = [2, 3, a, b, 1]; arr2 = [2, 3, b, a, 1]; alert(JSON.stringify( [arr1.sort(), arr2.sort()] ,0,'\t'))