Is it possible to sort and rearrange an array that looks like this:
itemsArray = [ [\'Anne\', \'a\'], [\'Bob\', \'b\'], [\'Henry\', \'b\'],
Use intersection of two arrays.
Ex:
var sortArray = ['a', 'b', 'c', 'd', 'e']; var arrayToBeSort = ['z', 's', 'b', 'e', 'a']; _.intersection(sortArray, arrayToBeSort)
=> ['a', 'b', 'e']
if 'z and 's' are out of range of first array, append it at the end of result