I have two arrays:
keys_array = [2,4,5,8,9]
values_array = ['two','four','five','eight','nine']
I need to get:
#transitional result
#values sorted alphabetically
sorted_by_value_name_array = [
['8','eight'],
['5','five'],
['4','four'],
['9','nine'],
['2','two']
]
#final result
sorted_keys_array = [8,5,4,9,2]
How can i achieve this with javascript or jQuery?
1 Answer