Skip to main content

List: Slice

Return a contiguous sub-list of an input list between Start (inclusive) and End (exclusive). Bounds are clamped to the input length, so out-of-range indices yield an empty result rather than failing. Mirrors JavaScript's Array.prototype.slice.

Example
Start: 1, End: 4
Input: [10, 20, 30, 40, 50]
Output: [20, 30, 40]

Parameters

Start

0-based start index, inclusive. Defaults to 0.

End

0-based end index, exclusive. Leave empty to slice to the end of the array. Indices past the end are clamped.

Input

ArrayREQUIRED

List to slice (Array or JSON array).

Output

Result
The sliced sub-list.