From 80d27273a2208c553f877051bf31d1a8faf3d81a Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Wed, 11 Sep 2024 20:35:42 +0300 Subject: [PATCH] Add polyfill for toSorted Fixes #2827 --- public/lib/polyfill.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/public/lib/polyfill.js b/public/lib/polyfill.js index b46d73906..cef73b4e5 100644 --- a/public/lib/polyfill.js +++ b/public/lib/polyfill.js @@ -11,3 +11,9 @@ if (!Array.prototype.findLastIndex) { return -1; }; } + +if (!Array.prototype.toSorted) { + Array.prototype.toSorted = function (compareFunction) { + return this.slice().sort(compareFunction); + }; +}