I have two arrays
- MRP
[60 80 82 50 80 80 ] - Brand
[ A B C D E F ]
I need to get top two brands based on MRP. highest two in MRP is 82 ,80 but 80 is 3 times repeated so i need all repeated values as well to get top two brands. i.e i need to display [C B E F]
For that i sorted MRP in descending order.Now MRP after sorting become [ 82 80 80 60 50 ]
Now i need to sort Brand Array based on Sorted MRP.Can some one help in this sorting using javascript .