arrayGetAt

Returns the element at an index. Negative indexes count back from the end, so -1 is the last element. Throws an error if the index is out of range.

arrayGetAt(array, index) → returns any

Member Function Syntax

someArray.at(index)

This function requires Adobe ColdFusion 2025.0.8 and up.  Not supported on Lucee, etc.

Argument Reference

array array
Required

The array.

index numeric
Required

1-based index, or a negative index to count from the end.

Examples
Sample code invoking the arrayGetAt function

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub