Parameters: It accepts two parameters which are described below:
- begin: It specifies the index of the starting element from which the part of the given array to be started. It is optional and inclusive.
- end: It specifies the index of the ending element up to which the part of the given array to be included. It is optional and exclusive.
Return value: It returns a new array which is formed from the given typedArray object.
10,15 10,15,20,25,30,35 20,25,30,35 5,10,15,20,25,30 5,10,15,20,25,30,35
When index are in negative then elements get accessed from the end of the typedArray object.
Below is the required code which illustrates this negative indexing concept.
35 30,35 25,30,35 20,25,30,35 5,10,15,20,25,30,35