JavaScript Array: slice vs splice - don't code today what you can't debug tomorrow -
An important aspect of slice is that it does not change the array which invokes it. The following code fragment illustrates the behavior. As you can see, x keeps its elements and y gets the sliced version thereof....