if i have an array of values, and an array of characters
var values = [31, 11, 10, 51]
var chars = ['a', 'b', 'c', 'd']
i then sort the values array with .sort
values.sort(function(a, b){return a-b}); // result: [10, 11, 31, 51]
if i then want the chars array to be sorted to match the values array - how do i go about doing that ?
so that the result will be:
// wanted result
[10, 11, 31, 51]
['c','b','a','d']