I have data in javascript from ajax like below.
data:{site: ["abc", "def", "gfr"], month: ["3", "2", "6"], value: ["10", "21", "1"]}
I want sort the data by month.
result I want:
data: {site: ["def", "abc", "gfr"], month: ["2", "3", "6"], value: ["21", "10", "1"]}
I know I can sort array like data.month.sort() but it sorts only month array. How do I sort all of values by one key's value?