slice
container slice(container, startIndex, endIndex)
Returns a portion (subsection) of container.
- An array container returns a new array with the elements from startIndex through endIndex.
- A text container returns a text with the characters from startIndex through endIndex.
Arguments
- container — array or text return a subsection of.
- startIndex — optional index (inclusive) of first element or character. 0 if omitted.
- endIndex — optional index (exclusive) of last element or character. Length of container if omitted.
Returns
- a subsection of container.