← Your `.sort()` is mutating state. JavaScript finally gave you the fix.
Playground

sort() vs toSorted() — watch the reference

preview

Edits run in a sandbox in your browser — nothing is saved and nothing leaves the page.