Add polyfill for toSorted Fixes #2827
| @@ -11,3 +11,9 @@ if (!Array.prototype.findLastIndex) { | |||
| 11 | return -1; | 11 | return -1; |
| 12 | }; | 12 | }; |
| 13 | } | 13 | } |
| 14 | |||
| 15 | if (!Array.prototype.toSorted) { | ||
| 16 | Array.prototype.toSorted = function (compareFunction) { | ||
| 17 | return this.slice().sort(compareFunction); | ||
| 18 | }; | ||
| 19 | } | ||