function computeSortedOrder(arr, sortingFunc) {
  const orderedArr = arr
    .slice(0)
    .sort((a, b) => sortingFunc(a) - sortingFunc(b));
  return orderedArr.map(item => arr.indexOf(item));
}
compute the order after sorting an array, useful when the order is needed for sorting anothe array
@param  {Array} arr - array to sort
@param  {Function} sortingFunc - function based on which `arr` is sorted
@return {[Number]} item indices in the original `arr` in the order of a sorted array