var ss1=[18,74,6,9,32,1]; var ss2=["width","none","color","border","after","div"]; var s = []; ss1.sort(function(a,b){var a = b-a;s.push(a); return a}) ss2.sort(function(){return s.shift()}) alert(ss2);