![]() ![]() Now, consider an example where we do not provide any index. ![]() We observe from the above example that the 'numbers' array is not modified which means we still have the original array. It selects the elements starting at the given start argument, and ends at the given optional end argument without including the last element.īy default, the starting index will be 0 and the last index will be array.length but we can specify what index we want. It does not modify (immutable) the original array on which it is called upon. This method returns a shallow copy or a new array object of a portion of an array.
0 Comments
Leave a Reply. |