"Oops, an error occurred!"

OMG, you are a genius! Thank you so much, I can’t believe that worked.

Steps to Execute the Code:

  1. Load ChatGPT.
  2. Press F12 to open the Developer Tools.
  3. Go to the Console tab.
  4. Inject the following code:
if (!Array.prototype.toSorted) {
  Array.prototype.toSorted = function(compareFn) {
    compareFn = compareFn || ((a, b) => String(a).localeCompare(b));
    const arrayCopy = [...this];
    return arrayCopy.sort(compareFn);
  };
}
3 Likes