While we believe that this content benefits our community, we have not yet thoroughly reviewed it.
If you have any suggestions for improvements, please let us know by clicking the
“report an issue“ button at the bottom of the tutorial.
S.No.
Function Params
Usage
First Parameter
Starting index (Inclusive). It should be zero or any any positive integer less than the length of the Collection or String or Array.
Second Parameter
Ending index (Exclusive).
slice function extract elements starting from ‘first-index’ (Inclusive) to ‘until-index’ (exclusive). Here elements numbers for an Array of Numbers, Characters for a String, an object for a Collection.