Is it possible to sort and rearrange an array that looks like this:
itemsArray = [ [\'Anne\', \'a\'], [\'Bob\', \'b\'], [\'Henry\', \'b\'],
You could try this method.
const sortListByRanking = (rankingList, listToSort) => { let result = [] for (let id of rankingList) { for (let item of listToSort) { if (item && item[1] === id) { result.push(item) } } } return result }