Randomize two arrays the same way, javascript
<p>I'm using javascript and trying to sync two arrays so that both arrays have the same index location.</p>

<pre><code>    var array1 = ["word1","word2","word3","word4","word5"];
    var array2 = [1,2,3,4,5];

    array2.sort(function(){ return Math.random() -.5});
</code></pre>

<p>This scrambles array2 into something like [2,3,1,5,4]</p>

<p>Now I need array1 to get the same order: <code>["word2", "word3", "word1", "word 5", "word4"]</code></p>

<p>How can I do this? </p>
