Array.prototype.toSplicedintermediateconst arr = [1, 2, 3]
arr.splice(0, 1) // mutates arr β [2, 3]
const r = [1,2,3].toSpliced(0, 1) // safe β [2, 3]Prefer toSpliced() over splice() in functional code to avoid unintended mutation.
While splice mutates and returns removed elements, toSpliced always returns a new array. The result is never the same reference as the input.
Implement toSplicedReturnsNew which returns true if arr.toSpliced(0, 0) is a different reference than arr.