Add polyfill for toSorted Fixes #2827

80d27273a2208c553f877051bf31d1a8faf3d81a

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +6 -0Showing whitespace changes
public/lib/polyfill.js+6 -0
@@ -11,3 +11,9 @@ if (!Array.prototype.findLastIndex) {
1111 return -1;
1212 };
1313}
14+
15+if (!Array.prototype.toSorted) {
16+ Array.prototype.toSorted = function (compareFunction) {
17+ return this.slice().sort(compareFunction);
18+ };
19+}