Is it possible to sort and rearrange an array that looks like this:
itemsArray = [ [\'Anne\', \'a\'], [\'Bob\', \'b\'], [\'Henry\', \'b\'],
function sortFunc(a, b) { var sortingArr = ["A", "B", "C"]; return sortingArr.indexOf(a.type) - sortingArr.indexOf(b.type); } const itemsArray = [ { type: "A", }, { type: "C", }, { type: "B", }, ]; console.log(itemsArray); itemsArray.sort(sortFunc); console.log(itemsArray);