sort an array by a number from another array code example
Example: sort array based on another array
arr.sort((a, b) =>{
return sortingArray.indexOf(a) - sortingArray.indexOf(b);
});
arr.sort((a, b) =>{
return sortingArray.indexOf(a) - sortingArray.indexOf(b);
});