JavaScript Array slice() Method
The Array slice() method returns selected elements in an array as a new array. It selects from a given start, up to a (not inclusive) given end. This method does not change the original array, enabling non-destructive extraction of array segments.Syntax:arr.slice(begin, end);Parameters:begin: This p