months = ['Apr','Jan','Jul','Jun']
values = ['2','4','10','1']
How do I sort them not alphabetically but customized like below so the sorted arrays should be:
sMonths = ['Jan','Apr','Jun','Jul']
sValues = ['4','2','1','10']
I am guessing it should be done by map method? I checked here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort
But I couldn't really understand how to do it.