title: Reorder an array according to given index in javaScript
body: <p>I am facing problem to change the index values of an array according to given index in javaScript. i have searched on StackOverflow and found some solution but those not working for me of are not for javaScript. The below input array and index is mentioned. </p>
  
  <pre><code>   Input:  arr[]   = [101, 102, 103];
     index[] = [1, 0, 2];
     Output: arr[]   = [102, 101, 103]
     index[] = [0,  1,  2] 
  </code></pre>
  
  <p>The founded answers are 
  <a href="https://stackoverflow.com/questions/46775994/reorder-array-according-to-given-index">reorder array according to given index</a> </p>
  
  <p><a href="https://stackoverflow.com/questions/42695650/php-sort-an-array-according-to-second-given-array">php - sort an array according to second given array</a></p>
  
  <p><a href="https://stackoverflow.com/questions/25820887/rearrange-an-array-according-to-key">Rearrange an array according to key</a></p>
  
  <p><a href="https://stackoverflow.com/questions/15540211/sorting-an-array-according-to-the-order-of-another-array">Sorting an Array according to the order of another Array</a></p>
  
  <p>Any kind of hint/solution is highly appreciated.</p>