In brief
The final index does not enter the copied part.
Useful to know
slice(start, end) returns a shallow copy of a part of an array without changing the original. For example, [10, 20, 30, 40].slice(1, 3) gives [20, 30]. The beginning is on, the end is not . [1]
For the first three items, use slice(0, 3), and not slice(0, 2). The method is convenient for previewing a list. If items are objects, internal objects remain shared: a new container does not mean an independent copy of each property. Do not mix slice with splice, which changes the array.
Sources
For further detail and to check the information: