JavaScript slice function is used to extract array from start index parameter to end index parameter. See the code snippet:
slice