function isSorted(arr, opt_compareFn, opt_strict) {
  const compare = opt_compareFn || defaultCompare;
  for (let i = 1; i < arr.length; i++) {
    const compareResult = compare(arr[i - 1], arr[i]);
    if (compareResult > 0 || compareResult == 0 && opt_strict) {
      return false;
    }
  }
  return true;
}
Tells if the array is sorted.
@param {!IArrayLike<T>} arr The array.
@param {?function(T,T):number=} opt_compareFn Function to compare the
    array elements.
    Should take 2 arguments to compare, and return a negative number, zero,
    or a positive number depending on whether the first argument is less
    than, equal to, or greater than the second.
@param {boolean=} opt_strict If true no equal elements are allowed.
@return {boolean} Whether the array is sorted.
@template T