Is it possible to sort and rearrange an array that looks like this:
itemsArray = [ [\'Anne\', \'a\'], [\'Bob\', \'b\'], [\'Henry\', \'b\'],
You can do something like this:
function getSorted(itemsArray , sortingArr ) { var result = []; for(var i=0; i
You can test it out here.
Note: this assumes the arrays you pass in are equivalent in size, you'd need to add some additional checks if this may not be the case.
refer link
refer