JavaScript immutable array methods: toSorted(), toReversed(), toSpliced(), with()

Need to sort or reverse an array without mutating it? Use toSorted(), toReversed(), toSpliced(), and with() to get a new copy instead.