Immutable Array Methods Playground

Four pairs called for real on train #1: sort, reverse, splice and arr[i] = v change that train itself, toSorted, toReversed, toSpliced and with bring a new…

The key idea

The 'to' prefix returns a copy; without 'to' changes in place

Try it in this playground