var tmp = {}; for(var i = 0; i < ss1.length; i++) tmp[ss1[i]] = ss2[i]; ss1.sort(); ss3 = []; for(var i = 0; i < ss1.length; i++) ss3.push(tmp[ss1[i]]); delete(tmp);