sort / toSorted
Also written: sort, toSorted, reverse
`sort` puts an array in order by changing it, comparing as strings unless you pass a compare function. `toSorted` takes the same function but returns a sorted copy and leaves the original alone.
Also written: sort, toSorted, reverse
`sort` puts an array in order by changing it, comparing as strings unless you pass a compare function. `toSorted` takes the same function but returns a sorted copy and leaves the original alone.