Quantcast
Channel: Adobe Community : Popular Discussions - InDesign Scripting
Viewing all articles
Browse latest Browse all 15932

Sort algorithm: how can I sort two arrays according to one

$
0
0

I have two parallel arrays, similar to this:

 

var array1 = [4, 3, 1, 5, 2];

var array2 = ["four", "three", "one", "five", "two"];

 

I want to sort the first array, and have the second array follow the same sort as the first. Any advice for a good algorithm would be appreciated.

 

Rick Quatro


Viewing all articles
Browse latest Browse all 15932

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>