Wulan’s Thursday parcel list on train #1: sort() and reverse() shunt that train’s own wagons, toSorted() and toReversed() bring a new train onto track 2, and…
The key idea
sort and reverse change in place; toSorted and toReversed copy
Try it in this playground
Run sort() Train #1's own wagons move, and hasil hangs on the same locomotive as arr.
Run toSorted() A new train comes onto track 2; train #1 stays as you wrote it.
See the sneaky 10 Sort numbers like [10, 2, 1] with no comparator: you get text order.
Try reverse() then toReversed() The same pattern: the one without "to" changes the train itself, the one with "to" brings a new train.