static hasSameElements(a, b, compareFn) {
    if (!compareFn) {
      compareFn = shaka.util.ArrayUtils.defaultEquals;
    }
    if (a.length != b.length) {
      return false;
    }

    const copy = b.slice();
    for (const item of a) {
      const idx = copy.findIndex((other) => compareFn(item, other));
      if (idx == -1) {
        return false;
      }
      // Since order doesn't matter, just swap the last element with
      // this one and then drop the last element.
      copy[idx] = copy[copy.length - 1];
      copy.pop();
    }

    return copy.length == 0;
  }
Determines if the given arrays contain equal elements in any order.

@param {!Array<T>} a
@param {!Array<T>} b
@param {function(T, T):boolean=} compareFn
@return {boolean}
@template T