TAKE function

Synopsis
This function returns a portion of the source array.
Variations
TAKE(SourceArray, Count)
Returns a portion of the source array starting at index 1.
Parameters
SourceArray

Specifies the array to take elements from.

Supported types: Numeric array; String array; Boolean array; Point array; Object array.
Count

Specifies the number of elements to include in the returned array.

Supported types: Numeric.
Returns
Returned types: Numeric array; Boolean array; String array; Point array; Object array.
Examples
1.

In the following example, the function takes the items of the source array until the count is reached. The function returns [true, false, true].

TAKE([true, false, true, false, true, true, false, false, false], 3)
TAKE(SourceArray, StartIndex, Count)
Returns a portion of the source array starting at the specified index.
Parameters
SourceArray

Specifies the array to take elements from.

Supported types: Numeric array; String array; Boolean array; Point array; Object array.
StartIndex

Specifies the index to use for the first element in the new array.

Supported types: Numeric.
Count

Specifies the number of elements to include in the returned array.

Supported types: Numeric.
Returns
Returned types: Numeric array; Boolean array; String array; Point array; Object array.
Examples
1.

In the following example, the function takes the items of the source array, starting at the specified index until the count is reached. The function returns [false, false, false].

TAKE([true, false, true, false, true, true, false, false, false], 7, 3)