I have and array of strings:
var arrStr = ["Ron", "Jhon", "Mary", "Alex", "Ben"];
The above array is the default sort order that I require. I have another array of Strings:
var arrStr2 = ["Mary", "Alex", "Jhon"];
I wanted to sort arrStr2 with the sort order in arrStr. (the order in arrStr also can be changed, accordingly the arrStr2 should be sorted). arrStr2 can have more values also, but the values will be only from any of the values in array arrStr
After sorting I need an out put for arrStr2 as ["Jhon","Mary","Alex"];
How can I achieve this using jQuery?